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>] [day] [month] [year] [list]
Message-Id: <1285996652-3224-1-git-send-email-rahul.ruikar@gmail.com>
Date:	Sat,  2 Oct 2010 10:47:32 +0530
From:	Rahul Ruikar <rahul.ruikar@...il.com>
To:	David Brownell <dbrownell@...rs.sourceforge.net>,
	Greg Kroah-Hartman <gregkh@...e.de>, Tejun Heo <tj@...nel.org>
Cc:	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
	Rahul Ruikar <rahul.ruikar@...il.com>
Subject: [PATCH] usb: gadget: ci13xxx_udc: Fix error path

call put_device() when device_register() fails.

Signed-off-by: Rahul Ruikar <rahul.ruikar@...il.com>
---
 drivers/usb/gadget/ci13xxx_udc.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c
index 6996951..f330833 100644
--- a/drivers/usb/gadget/ci13xxx_udc.c
+++ b/drivers/usb/gadget/ci13xxx_udc.c
@@ -2635,8 +2635,10 @@ static int udc_probe(struct device *dev, void __iomem *regs, const char *name)
 	udc->gadget.dev.release  = udc_release;
 
 	retval = device_register(&udc->gadget.dev);
-	if (retval)
+	if (retval) {
+		put_device(&udc->gadget.dev);
 		goto done;
+	}
 
 #ifdef CONFIG_USB_GADGET_DEBUG_FILES
 	retval = dbg_create_files(&udc->gadget.dev);
-- 
1.7.2.3

--
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