[PATCH v3 02/16] device-dax: fix cdev leak

Johannes Thumshirn jthumshirn at suse.de
Mon Mar 6 00:27:18 PST 2017


On 03/06/2017 08:04 AM, Logan Gunthorpe wrote:
> From: Dan Williams <dan.j.williams at intel.com>
> 
> 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 at vger.kernel.org>
> Reported-by: Jason Gunthorpe <jgunthorpe at obsidianresearch.com>
> Signed-off-by: Dan Williams <dan.j.williams at intel.com>
> Signed-off-by: Logan Gunthorpe <logang at deltatee.com>
> ---

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>


-- 
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850



More information about the linux-mtd mailing list