]> git.baikalelectronics.ru Git - kernel.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>
Mon, 7 Jan 2013 17:31:30 +0000 (12:31 -0500)
commit55e0f614a6ce3ff3b291231bfe373def919d2475
tree5b6bff7041a69808997cb2857ddce701a24f9d77
parent507614f28bb4cd42c60f87632f6ac052666ad6bf
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 011b9ca726f8b8d64713a9b87ddbd61755084e88 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