From: Bjorn Helgaas <bhelgaas@google.com>
To: Levente Kurusa <levex@linux.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/4] eisa: call put_device if device_register fails
Date: Fri, 13 Dec 2013 12:04:00 -0700 [thread overview]
Message-ID: <20131213190400.GB6746@google.com> (raw)
In-Reply-To: <1386959996-7958-3-git-send-email-levex@linux.com>
On Fri, Dec 13, 2013 at 07:39:54PM +0100, Levente Kurusa wrote:
> We need to give up the last reference to edev->dev, so
> we need to call put_device().
>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Signed-off-by: Levente Kurusa <levex@linux.com>
I applied this and will push it through my PCI tree, since I don't think
anybody really takes care of EISA these days.
I looked at other callers of device_register(), and most of them look like
they have the same problem. Can you fix the others, too? This patch says
"2/4", so maybe you already are, but I can't find the other patches in the
series.
Bjorn
> ---
> drivers/eisa/eisa-bus.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/eisa/eisa-bus.c b/drivers/eisa/eisa-bus.c
> index 272a3ec..8842cde 100644
> --- a/drivers/eisa/eisa-bus.c
> +++ b/drivers/eisa/eisa-bus.c
> @@ -232,8 +232,10 @@ static int __init eisa_init_device(struct eisa_root_device *root,
> static int __init eisa_register_device(struct eisa_device *edev)
> {
> int rc = device_register(&edev->dev);
> - if (rc)
> + if (rc) {
> + put_device(&edev->dev);
> return rc;
> + }
>
> rc = device_create_file(&edev->dev, &dev_attr_signature);
> if (rc)
> --
> 1.8.3.1
>
next parent reply other threads:[~2013-12-13 19:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1386959996-7958-1-git-send-email-levex@linux.com>
[not found] ` <1386959996-7958-3-git-send-email-levex@linux.com>
2013-12-13 19:04 ` Bjorn Helgaas [this message]
2013-12-13 19:08 ` [PATCH 2/4] eisa: call put_device if device_register fails Levente Kurusa
[not found] ` <1386959996-7958-2-git-send-email-levex@linux.com>
2013-12-14 17:25 ` [PATCH 1/4] net: phy: call put_device on device_register() failure Greg Kroah-Hartman
[not found] ` <1386959996-7958-4-git-send-email-levex@linux.com>
2013-12-16 4:52 ` [PATCH 3/4] backlight: lcd: call put_device if device_register fails Jingoo Han
2013-12-16 4:52 ` Jingoo Han
2013-12-16 17:16 ` Levente Kurusa
2013-12-16 17:16 ` Levente Kurusa
2014-01-07 1:42 ` Jingoo Han
2014-01-07 1:42 ` Jingoo Han
2013-12-13 19:22 [PATCH 0/4] treewide: add missing put_device calls Levente Kurusa
2013-12-13 19:22 ` [PATCH 2/4] eisa: call put_device if device_register fails Levente Kurusa
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=20131213190400.GB6746@google.com \
--to=bhelgaas@google.com \
--cc=levex@linux.com \
--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 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.