Re: [PATCH 1/3] platform/x86: int3472: Avoid crash in unregistering regulator gpio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 24, 2023 at 11:51:33AM +0800, bingbu.cao@xxxxxxxxx wrote:
> From: Hao Yao <hao.yao@xxxxxxxxx>
> 
> 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.

It should return deferred probe and if somebody is asking for troubles with
it...

Probably you need to assign only available GPIOs by introducing a local variable

	struct gpio_desc *gdesc;

	gdesc = ...
	if (IS_ERR(gdesc))
		...

	...->... = gdesc;

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux