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)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Wed, 15 Nov 2023 12:32:27 +0000 (14:32 +0200)
commit5736aa9537c9b8927dec32d3d47c8c31fe560f62
treea13cfd797a11bd9c1dc3e8d833a2a9773c4ce525
parentc5dbf04160005e07e8ca7232a7faa77ab1547ae0
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>
drivers/platform/x86/hp/hp-bioscfg/bioscfg.c