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