summaryrefslogtreecommitdiff
path: root/drivers/extcon/extcon.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-15 09:36:55 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-15 09:36:55 +0100
commite01b7d04a61cf9684cc4145ddfc32f3010f6c03d (patch)
tree40c9ad7dc5db19f34c748212db44a9af3bef8c41 /drivers/extcon/extcon.c
parent1e28eed17697bcf343c6743f0028cc3b5dd88bf0 (diff)
parentd3bdd1c3140724967ca4136755538fa7c05c2b4e (diff)
Merge tag 'extcon-fixes-for-5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next
Chanwoo writes: Update extcon for v5.12-rc4 Detailed update of this pull request as following: 1. Add stubs of extcon_register_notifier_all() function for when CONFIG_EXTCON is disabled. 2. Fix exception handling in extcon_dev_register() when failed to initialize the extcon device. * tag 'extcon-fixes-for-5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon: extcon: Fix error handling in extcon_dev_register extcon: Add stubs for extcon_register_notifier_all() functions
Diffstat (limited to 'drivers/extcon/extcon.c')
-rw-r--r--drivers/extcon/extcon.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index 0a6438cbb3f3..e7a9561a826d 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -1241,6 +1241,7 @@ int extcon_dev_register(struct extcon_dev *edev)
sizeof(*edev->nh), GFP_KERNEL);
if (!edev->nh) {
ret = -ENOMEM;
+ device_unregister(&edev->dev);
goto err_dev;
}