[rtc-linux] Re: [PATCH v3 08/16] IB/ucm: utilize new cdev_device_add helper function

From
Leon Romanovsky <leon@kernel.org>
Date
2017-03-06 07:24:54
Also in
linux-fsdevel, linux-gpio, linux-input, linux-rdma, linux-scsi, nvdimm
On Mon, Mar 06, 2017 at 12:04:24AM -0700, Logan Gunthorpe wrote:
From: Jason Gunthorpe <redacted>

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 <redacted>
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
---
Thanks,
Reviewed-by: Leon Romanovsky <redacted>

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachments

Thread (1 message) 1 message, 1 author, last reply 2017-03-06
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help