On 03/06/2017 08:04 AM, Logan Gunthorpe wrote:
> From: Dan Williams <[email protected]>
> 
> 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: <[email protected]>
> Reported-by: Jason Gunthorpe <[email protected]>
> Signed-off-by: Dan Williams <[email protected]>
> Signed-off-by: Logan Gunthorpe <[email protected]>
> ---

Looks good,
Reviewed-by: Johannes Thumshirn <[email protected]>


-- 
Johannes Thumshirn                                          Storage
[email protected]                                +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
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to