RE: staging: comedi: me_daq: store the pci_dev in the comedi_device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday, October 23, 2012 7:04 AM, Dan Carpenter wrote:
> 
> Hello H Hartley Sweeten,
>
> This is a semi-automatic email about new static checker warnings.
>
> The patch 27034e8ace5a: "staging: comedi: me_daq: store the pci_dev 
> in the comedi_device" from Jul 18, 2012, leads to the following 
> Smatch complaint:
>
> drivers/staging/comedi/drivers/me_daq.c:797 me_detach()
>	 error: we previously assumed 'dev_private' could be null (see line 788)
>
> drivers/staging/comedi/drivers/me_daq.c
>    787	
>    788		if (dev_private) {
>                     ^^^^^^^^^^^
> Old check.
>
>    789			if (dev_private->me_regbase) {
>    790				me_reset(dev);
>    791				iounmap(dev_private->me_regbase);
>    792			}
>    793			if (dev_private->plx_regbase)
>    794				iounmap(dev_private->plx_regbase);
>    795		}
>    796		if (pcidev) {
>    797			if (dev_private->plx_regbase_size)
>                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> This dereference was previously under the check but the patch moves it
> outside.
>
>    798				comedi_pci_disable(pcidev);
>    799			pci_dev_put(pcidev);

Ugh.. overlooked that, and the pci_dev_put()...

I just posted a patch series for the me_daq driver. This issue is
addressed in:

[PATCH 01/23] staging: comedi: me_daq: fix pointer dereference in me_detach()

The pci_dev_put() issue is addressed in:

[PATCH 13/23] staging: comedi: me_daq: remove pci_dev_put() in detach

Regards,
Hartley
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux