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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1285998096-3385-1-git-send-email-rahul.ruikar@gmail.com>
Date:	Sat,  2 Oct 2010 11:11:36 +0530
From:	Rahul Ruikar <rahul.ruikar@...il.com>
To:	Li Yang <leoli@...escale.com>,
	David Brownell <dbrownell@...rs.sourceforge.net>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Dinh Nguyen <Dinh.Nguyen@...escale.com>,
	Anton Vorontsov <avorontsov@...mvista.com>
Cc:	linux-usb@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
	linux-kernel@...r.kernel.org,
	Rahul Ruikar <rahul.ruikar@...il.com>,
	Rahul Ruikar <raul.ruikar@...il.com>
Subject: [PATCH] usb: gadget: fsl_udc_core: Fix error path

call put_device() when device_register() fails.

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

diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index 08a9a62..491fc7a 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -2340,8 +2340,10 @@ static int __init fsl_udc_probe(struct platform_device *pdev)
 	udc_controller->gadget.dev.release = fsl_udc_release;
 	udc_controller->gadget.dev.parent = &pdev->dev;
 	ret = device_register(&udc_controller->gadget.dev);
-	if (ret < 0)
+	if (ret < 0) {
+		put_device(&udc_controller->gadget.dev);
 		goto err_free_irq;
+	}
 
 	/* setup QH and epctrl for ep0 */
 	ep0_setup(udc_controller);
-- 
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