]> git.karo-electronics.de Git - karo-tx-linux.git/commit
acer-wmi: fix obj is NULL but dereferenced
authorLee, Chun-Yi <joeyli.kernel@gmail.com>
Fri, 14 Dec 2012 08:14:26 +0000 (16:14 +0800)
committerMatthew Garrett <matthew.garrett@nebula.com>
Wed, 26 Dec 2012 16:07:16 +0000 (11:07 -0500)
commit727651bf738b6b917335025d09323d0962eda114
tree2df8139d663be3d6d95769a5dfbf488f8e521646
parente82ae2e45cd14469a982916b8c7826f89f742b09
acer-wmi: fix obj is NULL but dereferenced

Fengguang Wu run coccinelle and warns about:
  drivers/platform/x86/acer-wmi.c:1200:17-21: ERROR: obj is NULL but dereferenced.
  drivers/platform/x86/acer-wmi.c:891:17-21: ERROR: obj is NULL but dereferenced.
  drivers/platform/x86/acer-wmi.c:1953:17-21: ERROR: obj is NULL but dereferenced.

It causes by the code in patch 987dfbaa65b2c3568b85e29d2598da08a011ee09 doesn't check
obj variable should not be NULL. There have risk for dereference a NULL obj, so add
this patch to fix.

Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
drivers/platform/x86/acer-wmi.c