소스 검색

gpio: remember to finally free gpio_device

When the device core reference count for the device goes to
0 and it calls .release() we free resources and so can also
finally free up the GPIO state container, struct gpio_device.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij 9 년 전
부모
커밋
9efd9e6956
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      drivers/gpio/gpiolib.c

+ 1 - 0
drivers/gpio/gpiolib.c

@@ -405,6 +405,7 @@ static void gpiodevice_release(struct device *dev)
 	cdev_del(&gdev->chrdev);
 	list_del(&gdev->list);
 	ida_simple_remove(&gpio_ida, gdev->id);
+	kfree(gdev);
 }
 
 /**