platform/x86: think-lmi: Fix check for admin password being set
authorHans de Goede <hdegoede@redhat.com>
Wed, 9 Jun 2021 15:17:51 +0000 (17:17 +0200)
committerHans de Goede <hdegoede@redhat.com>
Wed, 16 Jun 2021 15:47:55 +0000 (17:47 +0200)
commit86bb2e3daf5d84c02ef40da8bf26f7b851aaa8a7
tree3a75adcf645134c09a5709f6e01c69cd800b9bac
parentcb58c277ff1a35432cd84a6cc9768c60ce4c2cad
platform/x86: think-lmi: Fix check for admin password being set

tlmi_priv.pwd_admin->password is an array (not a pointer), so the correct
way to check for the password being set is to check for
tlmi_priv.pwd_admin->password[0] != 0.

For the second check, replace the check with checking that auth_str is
set instead.

Cc: Mark Pearson <markpearson@lenovo.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1505158 ("NO_EFFECT")
Fixes: a7314b3b1d8a ("platform/x86: think-lmi: Add WMI interface support on Lenovo platforms")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210609151752.156902-1-hdegoede@redhat.com
drivers/platform/x86/think-lmi.c