From: Johan Hovold Date: Tue, 13 Jan 2015 12:00:05 +0000 (+0100) Subject: gpio: sysfs: fix gpio device-attribute leak X-Git-Tag: v3.2.67~38 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91111b535d9d2b7927b59639e738d395a9f835c0;p=pandora-kernel.git gpio: sysfs: fix gpio device-attribute leak commit 0915e6feb38de8d3601819992a5bd050201a56fa upstream. The gpio device attributes were never destroyed when the gpio was unexported (or on export failures). Use device_create_with_groups() to create the default device attributes of the gpio class device. Note that this also fixes the attribute-creation race with userspace for these attributes. Remove contingent attributes in export error path and on unexport. Fixes: d8f388d8dc8d ("gpio: sysfs interface") Signed-off-by: Johan Hovold Signed-off-by: Linus Walleij [bwh: Backported to 3.2: adjust filename, context] Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed