summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2017-03-17 12:48:09 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-21 06:44:32 +0100
commited01e50acdd3e4a640cf9ebd28a7e810c3ceca97 (patch)
tree831c42c463fbf11a2e6da50ab68b5e8854de68c2 /drivers/gpio/gpiolib.c
parent233ed09d7fdacf592ee91e6c97ce5f4364fbe7c0 (diff)
device-dax: fix cdev leak
If device_add() fails, cleanup the cdev. Otherwise, we leak a kobj_map() with a stale device number. As Jason points out, there is a small possibility that userspace has opened and mapped the device in the time between cdev_add() and the device_add() failure. We need a new kill_dax_dev() helper to invalidate any established mappings. Fixes: ba09c01d2fa8 ("dax: convert to the cdev api") Cc: <stable@vger.kernel.org> Reported-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpio/gpiolib.c')
0 files changed, 0 insertions, 0 deletions