OSDN Git Service

platform/x86: dell-wmi-sysman: fix init_bios_attributes() error handling
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 3 Nov 2020 10:17:35 +0000 (13:17 +0300)
committerHans de Goede <hdegoede@redhat.com>
Mon, 9 Nov 2020 11:54:24 +0000 (12:54 +0100)
commit20f67902824f04bc9a319814d5872c8ff6a74559
tree2cf8e5cf72b678ac3447b79361af98b8fd605f60
parent274335f1c557fe6f714b0b3369f6c466b38485c8
platform/x86: dell-wmi-sysman: fix init_bios_attributes() error handling

Calling release_attributes_data() while holding the "wmi_priv.mutex"
will lead to a dead lock.  The other problem is that if kzalloc() fails
then this should return -ENOMEM but currently it returns success.

Fixes: e8a60aa7404b ("platform/x86: Introduce support for Systems Management Driver over WMI for Dell Systems")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20201103101735.GB1127762@mwanda
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/dell-wmi-sysman/sysman.c