summaryrefslogtreecommitdiffstats
path: root/drivers/extcon/extcon.c
diff options
context:
space:
mode:
authorPan Bian <bianpan2016@163.com>2016-12-03 16:56:49 +0800
committerChanwoo Choi <cw00.choi@samsung.com>2017-01-09 10:04:09 +0900
commite7d9dd5ab15fa6d895929176592d6946bf329cf8 (patch)
tree6a13f283d351931c8129820befa785397d5e5c93 /drivers/extcon/extcon.c
parent8a522bf2d4f788306443d36b26b54f0aedcdfdbe (diff)
downloadop-kernel-dev-e7d9dd5ab15fa6d895929176592d6946bf329cf8.zip
op-kernel-dev-e7d9dd5ab15fa6d895929176592d6946bf329cf8.tar.gz
extcon: Return error code on failure
Function get_zeroed_page() returns a NULL pointer if there is no enough memory. In function extcon_sync(), it returns 0 if the call to get_zeroed_page() fails. The return value 0 indicates success in the context, which is incosistent with the execution status. This patch fixes the bug by returning -ENOMEM. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188611 Signed-off-by: Pan Bian <bianpan2016@163.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon/extcon.c')
-rw-r--r--drivers/extcon/extcon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index 7829846..7c1e3a7 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -453,7 +453,7 @@ int extcon_sync(struct extcon_dev *edev, unsigned int id)
dev_err(&edev->dev, "out of memory in extcon_set_state\n");
kobject_uevent(&edev->dev.kobj, KOBJ_CHANGE);
- return 0;
+ return -ENOMEM;
}
length = name_show(&edev->dev, NULL, prop_buf);
OpenPOWER on IntegriCloud