Dan Williams ed01e50acd 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>
2017-03-21 06:44:32 +01:00
..
2017-03-03 21:36:56 -08:00
2017-02-23 15:57:04 -08:00
2017-03-03 16:15:48 -08:00
2017-03-09 15:12:27 +01:00
2017-03-21 06:44:32 +01:00
2017-03-10 09:53:00 -08:00
2017-03-04 11:26:18 -08:00
2017-02-23 15:57:04 -08:00
2017-02-21 11:51:42 -08:00
2017-02-22 19:23:14 -08:00
2017-02-23 11:53:22 -08:00
2017-03-01 09:46:02 -08:00
2017-02-20 17:23:57 -08:00
2017-02-23 15:57:04 -08:00
2017-03-02 13:53:13 -08:00
2017-03-11 00:08:39 -08:00
2017-03-09 12:23:30 -08:00
2017-02-23 11:53:22 -08:00