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-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <op.vj1o4pqf7p4s8u@pikus>
Date:	Mon, 04 Oct 2010 11:39:51 +0200
From:	Michał Nazarewicz <m.nazarewicz@...sung.com>
To:	David Brownell <dbrownell@...rs.sourceforge.net>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Christoph Hellwig <hch@....de>,
	Alan Stern <stern@...land.harvard.edu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Rahul Ruikar <rahul.ruikar@...il.com>
Cc:	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: gadget: file_storage: Fix error path

On Sun, 03 Oct 2010 06:55:17 +0200, Rahul Ruikar <rahul.ruikar@...il.com> wrote:
> call put_device() when device_register() fails.

Capital letter at the beginning of sentence please. ;)

>
> Signed-off-by: Rahul Ruikar <rahul.ruikar@...il.com>

Acked-by: Michal Nazarewicz <mina86@...a86.com>

(or even Reviewed? dunno if that makes sense for such a trivial patch.)

> ---
>  drivers/usb/gadget/file_storage.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
> index a857b7a..2c94318 100644
> --- a/drivers/usb/gadget/file_storage.c
> +++ b/drivers/usb/gadget/file_storage.c
> @@ -3413,6 +3413,7 @@ static int __ref fsg_bind(struct usb_gadget *gadget)
> 		if ((rc = device_register(&curlun->dev)) != 0) {
>  			INFO(fsg, "failed to register LUN%d: %d\n", i, rc);
> +			put_device(&curlun->dev);
>  			goto out;
>  		}
>  		if ((rc = device_create_file(&curlun->dev,

The same problem is with f_mass_storage.c.  I'd be nice if you'd resubmit your
patch with the below included as well:

diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 44e5ffe..0b86174 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -2764,6 +2764,7 @@ static struct fsg_common *fsg_common_init(struct fsg_common *common,
  		rc = device_register(&curlun->dev);
  		if (rc) {
  			INFO(common, "failed to register LUN%d: %d\n", i, rc);
+			put_device(&curlun->dev);
  			common->nluns = i;
  			goto error_release;
  		}

Thanks.

-- 
Best regards,                                        _     _
| Humble Liege of Serenely Enlightened Majesty of  o' \,=./ `o
| Computer Science,  Michał "mina86" Nazarewicz       (o o)
+----[mina86*mina86.com]---[mina86*jabber.org]----ooO--(_)--Ooo--
--
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