[PATCH v2] staging: pi433: fix race condition in pi433_open

Hugo Lefeuvre hle at owl.eu.com
Wed Jun 20 13:38:41 UTC 2018


On Wed, Jun 20, 2018 at 11:34:39AM +0300, Dan Carpenter wrote:
> On Tue, Jun 19, 2018 at 10:33:26PM -0400, Hugo Lefeuvre wrote:
> > @@ -1178,6 +1152,11 @@ static int pi433_probe(struct spi_device *spi)
> >  	device->tx_active = false;
> >  	device->interrupt_rx_allowed = false;
> >  
> > +	/* init rx buffer */
> > +	device->rx_buffer = kmalloc(MAX_MSG_SIZE, GFP_KERNEL);
> > +	if (!device->rx_buffer)
> > +		return -ENOMEM;
> 
> We need to free device.

Fixed in v3. Thanks !

regards,
 Hugo

-- 
             Hugo Lefeuvre (hle)    |    www.owl.eu.com
4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/attachments/20180620/34208ed1/attachment.asc>


More information about the devel mailing list