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)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 15 Mar 2021 02:09:38 +0000 (11:09 +0900)
commitd3bdd1c3140724967ca4136755538fa7c05c2b4e
tree40c9ad7dc5db19f34c748212db44a9af3bef8c41
parentc9570d4a5efd04479b3cd09c39b571eb031d94f4
extcon: Fix error handling in extcon_dev_register

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>
drivers/extcon/extcon.c