]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: sysfs: fix gpio-chip device-attribute leak
authorJohan Hovold <johan@kernel.org>
Tue, 13 Jan 2015 12:00:04 +0000 (13:00 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 15 Jan 2015 16:19:45 +0000 (17:19 +0100)
commite28c126b28dfa1ff6e4b7695d7b1c4c9693c98ef
tree4d2ede45420b2d5f9e2af0279c75c11dbad28112
parent153b325aee1df57fe8d95235e07da31be6169deb
gpio: sysfs: fix gpio-chip device-attribute leak

The gpio-chip device attributes were never destroyed when the device was
removed.

Fix by using device_create_with_groups() to create the device attributes
of the chip class device.

Note that this also fixes the attribute-creation race with userspace.

Fixes: 601455711103 ("gpio: sysfs interface")
Cc: stable <stable@vger.kernel.org> # v2.6.27+
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib-sysfs.c