1
0
Fork 0
remarkable-linux/drivers/dax
Dan Williams 8dd114ef78 device-dax: fix cdev leak
commit ed01e50acd upstream.

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: ba09c01d2f ("dax: convert to the cdev api")
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-20 14:28:41 +02:00
..
Kconfig device-dax: switch to srcu, fix rcu_read_lock() vs pte allocation 2017-04-27 09:10:39 +02:00
Makefile
dax.c device-dax: fix cdev leak 2017-05-20 14:28:41 +02:00
dax.h dax: convert devm_create_dax_dev to PTR_ERR 2016-10-07 16:45:59 -07:00
pmem.c device-dax: check devm_nsio_enable() return value 2016-10-28 14:35:25 -07:00