]> git.hungrycats.org Git - linux/commitdiff
platform/x86: hp-wmi: Fix error value for hp_wmi_tablet_state
authorCarlo Caione <carlo@endlessm.com>
Sun, 9 Apr 2017 13:56:07 +0000 (15:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Nov 2017 14:53:17 +0000 (15:53 +0100)
commit c7dfc2facbd69dad89b75e13c608da709668dcd0 upstream.

hp_wmi_tablet_state() fails to return the correct error code when
hp_wmi_perform_query() returns the HP WMI query specific error code
that is a positive value.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Cc: Philip Müller <philm@manjaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/platform/x86/hp-wmi.c

index 3d28318b342c72fd4ef8b20f6c3ba98fefa87cfc..2b721fd19a7a703df27652fa830a88fc414bffe5 100644 (file)
@@ -290,7 +290,7 @@ static int hp_wmi_tablet_state(void)
        int ret = hp_wmi_perform_query(HPWMI_HARDWARE_QUERY, 0, &state,
                                       sizeof(state), sizeof(state));
        if (ret)
-               return ret;
+               return -EINVAL;
 
        return (state & 0x4) ? 1 : 0;
 }