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: <1286004916-3948-1-git-send-email-rahul.ruikar@gmail.com>
Date:	Sat,  2 Oct 2010 13:05:16 +0530
From:	Rahul Ruikar <rahul.ruikar@...il.com>
To:	David Brownell <dbrownell@...rs.sourceforge.net>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Russell King <rmk+kernel@....linux.org.uk>,
	Harro Haan <hrhaan@...il.com>,
	H Hartley Sweeten <hsweeten@...ionengravers.com>,
	Nicolas Ferre <nicolas.ferre@...el.com>,
	Ryan Mallon <ryan@...ewatersys.com>
Cc:	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
	Rahul Ruikar <rahul.ruikar@...il.com>
Subject: [PATCH] usb: gadget: at91_udc: Fix error path

In function at91udc_probe()
call put_device() when device_register() fails.

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

diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 93ead19..43178e5 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1798,8 +1798,10 @@ static int __init at91udc_probe(struct platform_device *pdev)
 	}
 
 	retval = device_register(&udc->gadget.dev);
-	if (retval < 0)
+	if (retval < 0) {
+		put_device(&udc->gadget.dev);
 		goto fail0b;
+	}
 
 	/* don't do anything until we have both gadget driver and VBUS */
 	clk_enable(udc->iclk);
-- 
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