From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Sender: rtc-linux@googlegroups.com Received: from mail.kernel.org (mail.kernel.org. [198.145.29.136]) by gmr-mx.google.com with ESMTPS id r66si1216808pfb.7.2017.03.05.23.24.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Mar 2017 23:24:40 -0800 (PST) Date: Mon, 6 Mar 2017 09:24:54 +0200 From: Leon Romanovsky To: Logan Gunthorpe Cc: Greg Kroah-Hartman , Dan Williams , Alexander Viro , Johannes Thumshirn , Jan Kara , Arnd Bergmann , Sajjan Vikas C , Dmitry Torokhov , Linus Walleij , Alexandre Courbot , Peter Huewe , Marcel Selhorst , Jarkko Sakkinen , Jason Gunthorpe , Olof Johansson , Doug Ledford , Sean Hefty , Hal Rosenstock , Dmitry Vyukov , Haggai Eran , Parav Pandit , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Hans Verkuil , Mauro Carvalho Chehab , Artem Bityutskiy , Richard Weinberger , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Cyrille Pitchen , Matt Porter , Alexandre Bounine , Andrew Morton , Joe Perches , Lorenzo Stoakes , Vladimir Zapolskiy , Alessandro Zummo , Alexandre Belloni , Boaz Harrosh , "James E.J. Bottomley" , "Martin K. Petersen" , Stephen Bates , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-scsi@vger.kernel.org, rtc-linux@googlegroups.com, linux-mtd@lists.infradead.org, linux-media@vger.kernel.org, linux-iio@vger.kernel.org, linux-rdma@vger.kernel.org, linux-gpio@vger.kernel.org, linux-input@vger.kernel.org, linux-nvdimm@lists.01.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [rtc-linux] Re: [PATCH v3 08/16] IB/ucm: utilize new cdev_device_add helper function Message-ID: <20170306072454.GO14379@mtr-leonro.local> References: <1488783873-2614-1-git-send-email-logang@deltatee.com> <1488783873-2614-9-git-send-email-logang@deltatee.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Zl+NncWK+U5aSfTo" In-Reply-To: <1488783873-2614-9-git-send-email-logang@deltatee.com> Reply-To: rtc-linux@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , --Zl+NncWK+U5aSfTo Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline On Mon, Mar 06, 2017 at 12:04:24AM -0700, Logan Gunthorpe wrote: > From: Jason Gunthorpe > > 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 > Signed-off-by: Logan Gunthorpe > Reviewed-by: Logan Gunthorpe > --- Thanks, Reviewed-by: Leon Romanovsky -- 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. --Zl+NncWK+U5aSfTo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEkhr/r4Op1/04yqaB5GN7iDZyWKcFAli9DsUACgkQ5GN7iDZy WKfeDA/+LWy91DyEkMjdR+KX3aTKX/G4GD0Db7Md9hfiApMfYgs799aMb8HDklRv 63PSzGFLFG8xxUDl10DgzDj9xK2+6e7m4X9E6G6fISQlQuRhuKmKk4YO0Dtl0H+Z Mh7jEAWxQkwwyl1DM2R9BA5ObKDC0LENpGYfFnWZRYCQaQt5GE+bulio8YLprVTM qb30tmhpUVRTcAvLfJsvGo7V6qO7GZGi2WlaXiCjBuZFcv5yXUND1z2LeTSZAkrn hmqZslp/akY0zbqoo98/W3tBa3qtKC2TrYQtqWZOyD7VlrcZ/5HL4kGg+hF1tKEJ 6i8UXtRGL7/IiXDN+C1GEq1IApRSG/2lxbrNWNlCJrYPGfH3jgMSSkGbqesLtazR d3cjUTVRAHtyMcCn2jhlBx7d36Lz86X3+7U8j8k/pQ7txOPFb4U/f1PK2WStf/Kt 2MtsHSQwUddwPlngEAfiUMz1TyUUnYdunoN7kEMx78QOTh7lJs80GRpWkuyadS+p U275++T5UELgev2l6GLEqNbaAsaS94ES2BRMS5zxZEV+XOTQraqkv/Xir1Cp+LB9 Q6nqcjVFyH2xyywBm5mOfQZzbWStqiOLWvT6SrDKkYtYAJD0yXgHsaNrLo2e67sL 5BFyBpa5YoCqAelTgeVLFx+xFLyH3wYC+qChrDNbrwOE+8Fm7vY= =O0p7 -----END PGP SIGNATURE----- --Zl+NncWK+U5aSfTo--