From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Hartley Sweeten <HartleyS@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>,
"driverdev-devel@linuxdriverproject.org"
<driverdev-devel@linuxdriverproject.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] staging: comedi: amplc_dio200_common: prevent extra free_irq()
Date: Sun, 27 Jul 2014 11:45:13 -0700 [thread overview]
Message-ID: <20140727184513.GB29496@kroah.com> (raw)
In-Reply-To: <DC148C5AA1CEBA4E87973D432B1C2D8825F1E378@P3PWEX4MB008.ex4.secureserver.net>
On Fri, Jul 25, 2014 at 06:23:10PM +0000, Hartley Sweeten wrote:
> On Friday, July 25, 2014 10:07 AM, Ian Abbott wrote:
> > `dio200_detach()` in "amplc_dio200.c" calls
> > `amplc_dio200_common_detach()` in "amplc_dio200_common.c", followed by
> > `comedi_legacy_detach()` in "../drivers.c". Both of those functions
> > call `free_irq()` if `dev->irq` is non-zero. The second call produces a
> > warning message because the handler has already been freed. Prevent
> > that by setting `dev->irq = 0` in `amplc_dio200_common_detach()`.
> >
> > Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> > ---
> > drivers/staging/comedi/drivers/amplc_dio200_common.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/comedi/drivers/amplc_dio200_common.c b/drivers/staging/comedi/drivers/amplc_dio200_common.c
> > index 78700e8..3592e58 100644
> > --- a/drivers/staging/comedi/drivers/amplc_dio200_common.c
> > +++ b/drivers/staging/comedi/drivers/amplc_dio200_common.c
> > @@ -1202,8 +1202,10 @@ void amplc_dio200_common_detach(struct comedi_device *dev)
> >
> > if (!thisboard || !devpriv)
> > return;
> > - if (dev->irq)
> > + if (dev->irq) {
> > free_irq(dev->irq, dev);
> > + dev->irq = 0;
> > + }
> > }
> > EXPORT_SYMBOL_GPL(amplc_dio200_common_detach);
>
> Ian,
>
> I have already gave a Reviewed-by signoff for this series.
>
> After looking over the code I think a cleaner solution would be to:
>
> 1) Use comedi_legacy_detach() directly for the (*detach) in the
> legacy ISA driver.
> 2) Move the code from amplc_dio200_common_detach() into the
> (*detach) function for the PCI driver.
> 3) Remove the exported function amplc_dio200_common_detach().
So should I not apply these patches?
confused,
greg k-h
next prev parent reply other threads:[~2014-07-27 18:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-25 17:07 [PATCH 0/3] staging: comedi: amplc_dio200 detach cleanups Ian Abbott
2014-07-25 17:07 ` [PATCH 1/3] staging: comedi: amplc_dio200_common: prevent extra free_irq() Ian Abbott
2014-07-25 18:23 ` Hartley Sweeten
2014-07-27 18:45 ` Greg Kroah-Hartman [this message]
2014-07-28 9:27 ` Ian Abbott
2014-07-28 16:35 ` Hartley Sweeten
2014-07-25 17:07 ` [PATCH 2/3] staging: comedi: amplc_dio200_common: remove some tests from amplc_dio200_common_detach() Ian Abbott
2014-07-25 17:07 ` [PATCH 3/3] staging: comedi: amplc_dio200_pci: no need to test board pointer in dio200_pci_detach() Ian Abbott
2014-07-25 18:14 ` [PATCH 0/3] staging: comedi: amplc_dio200 detach cleanups Hartley Sweeten
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140727184513.GB29496@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=HartleyS@visionengravers.com \
--cc=abbotti@mev.co.uk \
--cc=driverdev-devel@linuxdriverproject.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox