linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Krill <ben@codiert.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.cz>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tty: nwpserial: Pass correct pointer to free_irq()
Date: Tue, 21 May 2013 09:18:10 +0200	[thread overview]
Message-ID: <1369120690.1945.9.camel@bne> (raw)
In-Reply-To: <1369069650-1742-1-git-send-email-lars@metafoo.de>

Acked-off-by: Benjamin Krill <ben@codiert.org>

On Mon, 2013-05-20 at 19:07 +0200, Lars-Peter Clausen wrote:
> free_irq() expects the same pointer that was passed to request_irq(), otherwise
> the IRQ is not freed.
> 
> The issue was found using the following coccinelle script:
> 
> <smpl>
> @r1@
> type T;
> T devid;
> @@
> request_irq(..., devid)
> 
> @r2@
> type r1.T;
> T devid;
> position p;
> @@
> free_irq@p(..., devid)
> 
> @@
> position p != r2.p;
> @@
> *free_irq@p(...)
> </smpl>
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> ---
>  drivers/tty/serial/nwpserial.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/nwpserial.c b/drivers/tty/serial/nwpserial.c
> index 77287c5..549c70a 100644
> --- a/drivers/tty/serial/nwpserial.c
> +++ b/drivers/tty/serial/nwpserial.c
> @@ -199,7 +199,7 @@ static void nwpserial_shutdown(struct uart_port *port)
>  	dcr_write(up->dcr_host, UART_IER, up->ier);
>  
>  	/* free irq */
> -	free_irq(up->port.irq, port);
> +	free_irq(up->port.irq, up);
>  }
>  
>  static int nwpserial_verify_port(struct uart_port *port,



      reply	other threads:[~2013-05-21  7:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-20 17:07 [PATCH] tty: nwpserial: Pass correct pointer to free_irq() Lars-Peter Clausen
2013-05-21  7:18 ` Benjamin Krill [this message]

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=1369120690.1945.9.camel@bne \
    --to=ben@codiert.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@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;
as well as URLs for NNTP newsgroup(s).