lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 13 Dec 2013 12:04:00 -0700
From:	Bjorn Helgaas <bhelgaas@...gle.com>
To:	Levente Kurusa <levex@...ux.com>
Cc:	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/4] eisa: call put_device if device_register fails

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@...gle.com>
> Signed-off-by: Levente Kurusa <levex@...ux.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
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ