platform/x86: int3472: Avoid crash in unregistering regulator gpio
authorHao Yao <hao.yao@intel.com>
Wed, 24 May 2023 03:51:33 +0000 (11:51 +0800)
committerHans de Goede <hdegoede@redhat.com>
Tue, 30 May 2023 10:10:22 +0000 (12:10 +0200)
commitfb109fba728407fa4a84d659b5cb87cd8399d7b3
tree87ef8dfe3cc38e74cc7652fd31c42be6d8297e7e
parent061c228967f0e3f7aecdd32ee370ee745d96168d
platform/x86: int3472: Avoid crash in unregistering regulator gpio

When int3472 is loaded before GPIO driver, acpi_get_and_request_gpiod()
failed but the returned gpio descriptor is not NULL, it will cause panic
in later gpiod_put(), so set the gpio_desc to NULL in register error
handling to avoid such crash.

Signed-off-by: Hao Yao <hao.yao@intel.com>
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Link: https://lore.kernel.org/r/20230524035135.90315-1-bingbu.cao@intel.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/intel/int3472/clk_and_regulator.c