All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/staging/comedi/drivers/ni_pcimio.c:1694 pcimio_attach_pci() warn: 'dev->irq' was not release
@ 2012-09-27  0:54 Fengguang Wu
  2012-09-27  9:46 ` drivers/staging/comedi/drivers/ni_pcimio.c:1694 pcimio_attach_pci() warn: 'dev->irq' was not rel Ian Abbott
  0 siblings, 1 reply; 2+ messages in thread
From: Fengguang Wu @ 2012-09-27  0:54 UTC (permalink / raw)
  To: kernel-janitors

Hi Bill, Ian,

FYI, this smatch warning probably exists from day 0 of the driver
code:

+ drivers/staging/comedi/drivers/ni_pcimio.c:1694 pcimio_attach_pci() warn: 'dev->irq' was not released on error

vim +1694 drivers/staging/comedi/drivers/ni_pcimio.c
  1678		dev->irq = mite_irq(devpriv->mite);
  1679	
  1680		if (dev->irq = 0) {
  1681			pr_warn("unknown irq (bad)\n");
  1682		} else {
  1683			pr_debug("( irq = %u )\n", dev->irq);
  1684			ret = request_irq(dev->irq, ni_E_interrupt, NI_E_IRQ_FLAGS,
  1685					  DRV_NAME, dev);
  1686			if (ret < 0) {
  1687				pr_warn("irq not available\n");
  1688				dev->irq = 0;
  1689			}
  1690		}
  1691	
  1692		ret = ni_E_init(dev);
  1693		if (ret < 0)
> 1694			return ret;
  1695	
  1696		dev->subdevices[NI_AI_SUBDEV].buf_change = &pcimio_ai_change;
  1697		dev->subdevices[NI_AO_SUBDEV].buf_change = &pcimio_ao_change;
  1698		dev->subdevices[NI_GPCT_SUBDEV(0)].buf_change = &pcimio_gpct0_change;
  1699		dev->subdevices[NI_GPCT_SUBDEV(1)].buf_change = &pcimio_gpct1_change;
  1700		dev->subdevices[NI_DIO_SUBDEV].buf_change = &pcimio_dio_change;
  1701	
  1702		return ret;

---
0-DAY kernel build testing backend         Open Source Technology Centre
Fengguang Wu, Yuanhan Liu                              Intel Corporation

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: drivers/staging/comedi/drivers/ni_pcimio.c:1694 pcimio_attach_pci() warn: 'dev->irq' was not rel
  2012-09-27  0:54 drivers/staging/comedi/drivers/ni_pcimio.c:1694 pcimio_attach_pci() warn: 'dev->irq' was not release Fengguang Wu
@ 2012-09-27  9:46 ` Ian Abbott
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Abbott @ 2012-09-27  9:46 UTC (permalink / raw)
  To: kernel-janitors

On 2012-09-27 01:54, Fengguang Wu wrote:
> Hi Bill, Ian,
>
> FYI, this smatch warning probably exists from day 0 of the driver
> code:
>
> + drivers/staging/comedi/drivers/ni_pcimio.c:1694 pcimio_attach_pci() warn: 'dev->irq' was not released on error
>
> vim +1694 drivers/staging/comedi/drivers/ni_pcimio.c
>    1678		dev->irq = mite_irq(devpriv->mite);
>    1679	
>    1680		if (dev->irq = 0) {
>    1681			pr_warn("unknown irq (bad)\n");
>    1682		} else {
>    1683			pr_debug("( irq = %u )\n", dev->irq);
>    1684			ret = request_irq(dev->irq, ni_E_interrupt, NI_E_IRQ_FLAGS,
>    1685					  DRV_NAME, dev);
>    1686			if (ret < 0) {
>    1687				pr_warn("irq not available\n");
>    1688				dev->irq = 0;
>    1689			}
>    1690		}
>    1691	
>    1692		ret = ni_E_init(dev);
>    1693		if (ret < 0)
>> 1694			return ret;
>    1695	
>    1696		dev->subdevices[NI_AI_SUBDEV].buf_change = &pcimio_ai_change;
>    1697		dev->subdevices[NI_AO_SUBDEV].buf_change = &pcimio_ao_change;
>    1698		dev->subdevices[NI_GPCT_SUBDEV(0)].buf_change = &pcimio_gpct0_change;
>    1699		dev->subdevices[NI_GPCT_SUBDEV(1)].buf_change = &pcimio_gpct1_change;
>    1700		dev->subdevices[NI_DIO_SUBDEV].buf_change = &pcimio_dio_change;
>    1701	
>    1702		return ret;

It should be fine.  `pcimio_attach_pci()` doesn't clean up after itself, 
but if it returns an error, `pcimio_detach()` will be called to clean up 
afterwards.  `pcimio_detach()` always executes the following statement:

	if (dev->irq)
		free_irq(dev->irq, dev);

where `dev` is the same `dev` that was passed to `pcimio_attach_pci()`.

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-27  9:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-27  0:54 drivers/staging/comedi/drivers/ni_pcimio.c:1694 pcimio_attach_pci() warn: 'dev->irq' was not release Fengguang Wu
2012-09-27  9:46 ` drivers/staging/comedi/drivers/ni_pcimio.c:1694 pcimio_attach_pci() warn: 'dev->irq' was not rel Ian Abbott

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.