#
5878e5b7 |
|
05-Mar-2024 |
Ricardo B. Marliere <ricardo@marliere.net> |
platform/x86: make fw_attr_class constant Since commit 43a7206b0963 ("driver core: class: make class_register() take a const *"), the driver core allows for struct class to be in read-only memory, so move the fw_attr_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at boot time. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net> Link: https://lore.kernel.org/r/20240305-class_cleanup-platform-v1-1-9085c97b9355@marliere.net Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
|
#
92c47597 |
|
13-Nov-2023 |
Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> |
platform/x86: hp-bioscfg: Remove unused obj in hp_add_other_attributes() acpi_object *obj is unused in this function, so delete it, also delete a unnecessary kfree(obj); Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20231113200742.3593548-4-harshit.m.mogalapalli@oracle.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
|
#
f40f9399 |
|
13-Nov-2023 |
Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> |
platform/x86: hp-bioscfg: Fix error handling in hp_add_other_attributes() 'attr_name_kobj' is allocated using kzalloc, but on all the error paths it is not freed, hence we have a memory leak. Fix the error path before kobject_init_and_add() by adding kfree(). kobject_put() must be always called after passing the object to kobject_init_and_add(). Only the error path which is immediately next to kobject_init_and_add() calls kobject_put() and not any other error path after it. Fix the error handling after kobject_init_and_add() by moving the kobject_put() into the goto label err_other_attr_init that is already used by all the error paths after kobject_init_and_add(). Fixes: a34fc329b189 ("platform/x86: hp-bioscfg: bioscfg") Cc: stable@vger.kernel.org # 6.6.x: c5dbf0416000: platform/x86: hp-bioscfg: Simplify return check in hp_add_other_attributes() Cc: stable@vger.kernel.org # 6.6.x: 5736aa9537c9: platform/x86: hp-bioscfg: move mutex_lock() down in hp_add_other_attributes() Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <error27@gmail.com> Closes: https://lore.kernel.org/r/202309201412.on0VXJGo-lkp@intel.com/ Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> [ij: Added the stable dep tags] Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20231113200742.3593548-3-harshit.m.mogalapalli@oracle.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
|
#
5736aa95 |
|
13-Nov-2023 |
Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> |
platform/x86: hp-bioscfg: move mutex_lock() down in hp_add_other_attributes() attr_name_kobj's memory allocation is done with mutex_lock() held, this is not needed. Move allocation outside of mutex_lock() so unlock is not needed when allocation fails. Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20231113200742.3593548-2-harshit.m.mogalapalli@oracle.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
|
#
c5dbf041 |
|
13-Nov-2023 |
Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> |
platform/x86: hp-bioscfg: Simplify return check in hp_add_other_attributes() All cases in switch-case have a same goto on error, move the return check out of the switch. This is a cleanup. Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20231113200742.3593548-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
|
#
981368e1 |
|
25-Sep-2023 |
Armin Wolf <W_Armin@gmx.de> |
platform/x86: hp-bioscfg: Fix reference leak If a duplicate attribute is found using kset_find_obj(), a reference to that attribute is returned which needs to be disposed accordingly using kobject_put(). Use kobject_put() to dispose the duplicate attribute in such a case. As a side note, a very similar bug was fixed in commit 7295a996fdab ("platform/x86: dell-sysman: Fix reference leak"), so it seems that the bug was copied from that driver. Compile-tested only. Fixes: a34fc329b189 ("platform/x86: hp-bioscfg: bioscfg") Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Armin Wolf <W_Armin@gmx.de> Reviewed-by: Jorge Lopez <jorge.lopez2@hp.com> Link: https://lore.kernel.org/r/20230925142819.74525-3-W_Armin@gmx.de Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
#
d4e695c0 |
|
18-Jul-2023 |
Dan Carpenter <dan.carpenter@linaro.org> |
platform/x86: hp-bioscfg: fix error reporting in hp_add_other_attributes() Return a negative error code instead of returning success. Fixes: a34fc329b189 ("platform/x86: hp-bioscfg: bioscfg") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/138641cc-52c0-41a5-8176-ad01c7e28c67@moroto.mountain Reviewed-by: Jorge Lopez <jorge.lopez2@hp.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
#
b3a8692d |
|
18-Jul-2023 |
Dan Carpenter <dan.carpenter@linaro.org> |
platform/x86: hp-bioscfg: prevent a small buffer overflow This function escapes certain special characters like \n. So if the last character in the string is a '\n' then it gets changed into two characters '\' and '\n'. But maybe we only have space for the '\' so we need to check for that. The "conv_dst_size" variable is always less than or to equal the "size" variable. It's easier to just check "conv_dst_size" instead of checking both. Fixes: a34fc329b189 ("platform/x86: hp-bioscfg: bioscfg") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/b4950310-e65f-412f-8d2b-90bb074a6572@moroto.mountain Reviewed-by: Jorge Lopez <jorge.lopez2@hp.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
#
a34fc329 |
|
08-Jun-2023 |
Jorge Lopez <jorge.lopez2@hp.com> |
platform/x86: hp-bioscfg: bioscfg Add common functions support to hp-bioscfg. HP BIOS Configuration driver purpose is to provide a driver supporting the latest sysfs class firmware attributes framework allowing the user to change BIOS settings and security solutions on HP Inc.’s commercial notebooks. Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com> Reviewed-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20230608163319.18934-4-jorge.lopez2@hp.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|