]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
extcon: Fix error handling in extcon_dev_register
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Tue, 19 Jan 2021 08:10:55 +0000 (16:10 +0800)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 8 Apr 2021 20:42:52 +0000 (15:42 -0500)
commitdc28f71f637a8344d7da97d908ba498346f16552
treec170c68d03a01f43ccdc16de73427794ecdcb6a0
parent26ab3f79e38e5ef33b3fc63ef78290c4dd13e65a
extcon: Fix error handling in extcon_dev_register

BugLink: https://bugs.launchpad.net/bugs/1923069
[ Upstream commit d3bdd1c3140724967ca4136755538fa7c05c2b4e ]

When devm_kcalloc() fails, we should execute device_unregister()
to unregister edev->dev from system.

Fixes: 046050f6e623e ("extcon: Update the prototype of extcon_register_notifier() with enum extcon")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/extcon/extcon.c