14 Dec, 2017
3 commits
-
commit 0631fb8b027f5968c2f5031f0b3ff7be3e4bebcc upstream.
The driver exit function needs to unregister both platform device and
driver. Also, during registration, register driver first and perform
error checks.Fixes: 049a59db34eb ("firmware: Google VPD sysfs driver")
Signed-off-by: Guenter Roeck
Tested-by: Randy Dunlap
Reviewed-by: Dmitry Torokhov
Signed-off-by: Greg Kroah-Hartman -
commit e4b28b3c3a405b251fa25db58abe1512814a680a upstream.
It doesn't make sense to have /sys/firmware/vpd if the device is not
instantiated, so tie its lifetime to the device.Fixes: 049a59db34eb ("firmware: Google VPD sysfs driver")
Signed-off-by: Guenter Roeck
Reviewed-by: Dmitry Torokhov
Tested-by: Randy Dunlap
Signed-off-by: Greg Kroah-Hartman -
commit 811d7e0215fb738fb9a9f0bcb1276516ad161ed1 upstream.
vpd sections are initialized during probe and thus should be destroyed
in the remove function.Fixes: 049a59db34eb ("firmware: Google VPD sysfs driver")
Signed-off-by: Guenter Roeck
Reviewed-by: Dmitry Torokhov
Tested-by: Randy Dunlap
Signed-off-by: Greg Kroah-Hartman
Signed-off-by: Greg Kroah-Hartman
28 Aug, 2017
1 commit
-
In functions vpd_sections_init() and vpd_section_init(), iounmap() is
used to unmap memory. However, in these cases, memunmap() should be
used.Signed-off-by: Pan Bian
Reviewed-by: Dmitry Torokhov
Signed-off-by: Greg Kroah-Hartman
12 Jun, 2017
1 commit
-
We want the char/misc driver fixes in here as well.
Signed-off-by: Greg Kroah-Hartman
27 May, 2017
1 commit
-
This reverts commit 7975bd4cca05a99aa14964cfa22366ee64da50ad, because
VPD relies on driver core to handle deferrals returned by
coreboot_table_find().Signed-off-by: Dmitry Torokhov
Reviewed-by: Guenter Roeck
Signed-off-by: Greg Kroah-Hartman
25 May, 2017
7 commits
-
There is no reason why VPD should register platform device and driver,
given that we do not use their respective kobjects to attach attributes,
nor do we need suspend/resume hooks, or any other features of device
core.Signed-off-by: Dmitry Torokhov
Reviewed-by: Guenter Roeck
Signed-off-by: Greg Kroah-Hartman -
ro_vpd and rw_vpd are static module-scope variables that are guaranteed
to be initialized with zeroes, there is no need for explicit memset().Signed-off-by: Dmitry Torokhov
Reviewed-by: Guenter Roeck
Signed-off-by: Greg Kroah-Hartman -
When creating name for the "raw" attribute, let's switch to using
kaspeintf() instead of doing it by hand. Also make sure we handle
errors.Signed-off-by: Dmitry Torokhov
Reviewed-by: Guenter Roeck
Signed-off-by: Greg Kroah-Hartman -
Instead of open-coding kstrndup with kzalloc + memcpy, let's use
the helper.Signed-off-by: Dmitry Torokhov
Reviewed-by: Guenter Roeck
Signed-off-by: Greg Kroah-Hartman -
kobject_del() only unlinks kobject, we need to use kobject_put() to
make sure kobject will go away completely.Fixes: 049a59db34eb ("firmware: Google VPD sysfs driver")
Signed-off-by: Dmitry Torokhov
Reviewed-by: Guenter Roeck
Signed-off-by: Greg Kroah-Hartman -
We should not free info->key before we remove sysfs attribute that uses
this data as its name.Fixes: 049a59db34eb ("firmware: Google VPD sysfs driver")
Signed-off-by: Dmitry Torokhov
Reviewed-by: Guenter Roeck
Signed-off-by: Greg Kroah-Hartman -
We should only add section attribute to the list of section attributes
if we successfully created corresponding sysfs attribute.Fixes: 049a59db34eb ("firmware: Google VPD sysfs driver")
Signed-off-by: Dmitry Torokhov
Reviewed-by: Guenter Roeck
Signed-off-by: Greg Kroah-Hartman
18 May, 2017
1 commit
-
This patch fixes several issues:
- if the 1st 'kzalloc' fails, we dereference a NULL pointer
- if the 2nd 'kzalloc' fails, there is a memory leak
- if 'sysfs_create_bin_file' fails there is also a memory leakFix it by adding a test after the first memory allocation and some error
handling paths to correctly free memory if needed.Signed-off-by: Christophe JAILLET
Signed-off-by: Greg Kroah-Hartman
27 Apr, 2017
1 commit
-
In case of error, the function platform_device_register_simple()
returns ERR_PTR() and never returns NULL. The NULL test in the
return value check should be replaced with IS_ERR().Fixes: 049a59db34eb ("firmware: Google VPD sysfs driver")
Signed-off-by: Wei Yongjun
Signed-off-by: Greg Kroah-Hartman
19 Apr, 2017
1 commit
-
This patch introduces the Google Vital Product Data driver.
This driver reads Vital Product Data from coreboot tables and then
creates the corresponding sysfs entries under /sys/firmware/vpd to
provide easy access for userspace programs (does not require flashrom).The sysfs is structured as follow:
/sys/firmware/vpd
|-- ro
| |-- key1
| `-- key2
|-- ro_raw
|-- rw
| `-- key1
`-- rw_rawWhere ro_raw and rw_raw contain the raw VPD partition. The files under
ro and rw correspond to the key name in the VPD and the the file content
is the value for the key.Signed-off-by: Wei-Ning Huang
Signed-off-by: Thierry Escande
Signed-off-by: Greg Kroah-Hartman