提交 a24853aa 编写于 作者: A Arvind Yadav 提交者: Kalle Valo

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: NArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 79ca239a
......@@ -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++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册