mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dominik Brodowski <linux@dominikbrodowski.net>
To: Takeshi Yoshimura <yos@sslab.ics.keio.ac.jp>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Vaishali Thakkar <vthakkar1994@gmail.com>,
	linux-pcmcia@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] pcmcia: Add missing free_irq()
Date: Sun, 14 Jun 2015 16:28:34 +0200	[thread overview]
Message-ID: <20150614142834.GA3069@light.dominikbrodowski.net> (raw)
In-Reply-To: <1434284081-7207-1-git-send-email-yos@sslab.ics.keio.ac.jp>

[-- Attachment #1: Type: text/plain, Size: 1237 bytes --]

Hi Takeshi,

On Sun, Jun 14, 2015 at 09:14:41PM +0900, Takeshi Yoshimura wrote:
> In yenta_probe(), an irq leak potentially happens when
> pcmcia_register_socket() fails. I added the missed call.

nice catch, many thanks.

> index 965bd84..7922e30f 100644
> --- a/drivers/pcmcia/yenta_socket.c
> +++ b/drivers/pcmcia/yenta_socket.c
> @@ -1269,6 +1269,8 @@ static int yenta_probe(struct pci_dev *dev, const struct pci_device_id *id)
>  		pcmcia_unregister_socket(&socket->socket);
>  	}
>  
> +	if (socket->cb_irq)
> +		free_irq(socket->irq, socket);
>   unmap:
>  	iounmap(socket->base);
>   release:


However, this should also handle the case for sock->cb_irq being zero,
like it is done in yenta_close.

Furthermore, when comparing yenta_close and this error path in yenta_probe(),
I noticed a few other issues:
- yenta_free_resources() is not called in yenta_probe()
- pci_set_drvdata(dev, NULL) and kfree(socket) are not called in yenta_probe()
- sock->base is always set to non-NULL when yenta_close() is called,
  therefore the check in yenta_close() may be removed.

Would you be willing to update your patch to address also these issues?
Then, I'll happily push it upstream.

Best,
	Dominik

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-06-14 14:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-14 12:14 Takeshi Yoshimura
2015-06-14 14:28 ` Dominik Brodowski [this message]
2015-06-14 17:21   ` Takeshi Yoshimura

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=20150614142834.GA3069@light.dominikbrodowski.net \
    --to=linux@dominikbrodowski.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pcmcia@lists.infradead.org \
    --cc=vthakkar1994@gmail.com \
    --cc=yos@sslab.ics.keio.ac.jp \
    /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

all inboxes | Powered by JetHome®