]> git.baikalelectronics.ru Git - kernel.git/commit
extcon: return error code on failure
authorPan Bian <bianpan2016@163.com>
Sat, 3 Dec 2016 08:56:49 +0000 (16:56 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Jan 2017 08:11:39 +0000 (09:11 +0100)
commitc53e2d797ba56840de2a15e6085199381ecffeab
treec0b0c61921982c62c49ec4824616a646409237dd
parentaf0bdffe50ee59980b739a7fac0049196c1ca228
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>
Fixes: 3712eb8e27aad
Cc: stable <stable@vger.kernel.org>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/extcon/extcon.c