Search Linux Wireless

[PATCH] ssb:: use put_device() if device_register fail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



if device_register() returned an error! Always use put_device()
to give up the reference initialized.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@xxxxxxxxx>
---
 drivers/ssb/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index 65420a9..c4449e0 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -521,6 +521,7 @@ static int ssb_devices_register(struct ssb_bus *bus)
 			ssb_err("Could not register %s\n", dev_name(dev));
 			/* Set dev to NULL to not unregister
 			 * dev on error unwinding. */
+			put_device(dev);
 			sdev->dev = NULL;
 			kfree(devwrap);
 			goto error;
-- 
1.9.1




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux