Message ID | 20221109072132.117903-1-yuancan@huawei.com |
---|---|
State | New |
Headers | show |
Series | gpiolib: fix memory leak in gpiochip_setup_dev | expand |
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 4756ea08894f..fa659af86d07 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -539,6 +539,7 @@ static int gpiochip_setup_dev(struct gpio_device *gdev) err_remove_device: gcdev_unregister(gdev); + kfree(gdev->dev.p); return ret; }