platform/x86: hp-bioscfg: move mutex_lock() down in hp_add_other_attributes()
authorHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Mon, 13 Nov 2023 20:07:38 +0000 (12:07 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 3 Dec 2023 06:33:07 +0000 (07:33 +0100)
commite73ebb93558bb2028722adc23496f39c44cdd7f8
treed4a6cad73e986606f9eb1809964b1e1f7978f6fa
parenta9dc6f2e27baf909a61c428b7d03fd1312703230
platform/x86: hp-bioscfg: move mutex_lock() down in hp_add_other_attributes()

commit 5736aa9537c9b8927dec32d3d47c8c31fe560f62 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/platform/x86/hp/hp-bioscfg/bioscfg.c