[PATCH v3 08/16] IB/ucm: utilize new cdev_device_add helper function

Leon Romanovsky leon at kernel.org
Sun Mar 5 23:24:54 PST 2017


On Mon, Mar 06, 2017 at 12:04:24AM -0700, Logan Gunthorpe wrote:
> From: Jason Gunthorpe <jgunthorpe at obsidianresearch.com>
>
> The use after free is not triggerable here because the cdev holds
> the module lock and the only device_unregister is only triggered by
> module unload, however make the change for consistency.
>
> To make this work the cdev_del needs to move out of the struct device
> release function.
>
> This cleans up the error path significantly and thus also fixes a minor
> bug where the devnum would not be released if cdev_add failed.
>
> Signed-off-by: Jason Gunthorpe <jgunthorpe at obsidianresearch.com>
> Signed-off-by: Logan Gunthorpe <logang at deltatee.com>
> Reviewed-by: Logan Gunthorpe <logang at deltatee.com>
> ---

Thanks,
Reviewed-by: Leon Romanovsky <leonro at mellanox.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20170306/9d310e3e/attachment-0001.sig>


More information about the linux-mtd mailing list