summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2018-03-08 11:53:24 +0530
committerKalle Valo <kvalo@codeaurora.org>2018-03-13 18:48:29 +0200
commita24853aab59184ebd19c5e078c7b29e1c316e3a1 (patch)
tree4adce983a40d50df07b65b05bf70ed63fa71fc15 /drivers
parent79ca239a68f8f006ed872a023d97fbadf9d1577d (diff)
downloadlinux-a24853aab59184ebd19c5e078c7b29e1c316e3a1.tar.bz2
ssb: use put_device() if device_register fail
Never directly free @dev after calling device_register(), even if it returned an error! Always use put_device() to give up the reference initialized. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ssb/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index fdb89b6bfb40..116594413f66 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -522,7 +522,7 @@ static int ssb_devices_register(struct ssb_bus *bus)
/* Set dev to NULL to not unregister
* dev on error unwinding. */
sdev->dev = NULL;
- kfree(devwrap);
+ put_device(dev);
goto error;
}
dev_idx++;