From: Dan Carpenter <error27@gmail.com>
Date: Tue, 15 Mar 2011 07:07:37 +0000 (+0300)
Subject: asus-wmi: potential NULL dereference in show_call()
X-Git-Tag: firefly_0821_release~7613^2~1748^2^2~6
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a1d6086739c5b8f23a48e02e62b0e495321a2122;p=firefly-linux-kernel-4.4.55.git

asus-wmi: potential NULL dereference in show_call()

In the earlier check we assumed that "obj" could be NULL.  I looked at
some of the other places that call evaluate_object() and they check
for NULL as well.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
---

diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index a038595200ee..efc776cb0c66 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1343,7 +1343,7 @@ static int show_call(struct seq_file *m, void *data)
 	else
 		seq_printf(m, "%#x(%#x, %#x) = t:%d\n", asus->debug.method_id,
 			   asus->debug.dev_id, asus->debug.ctrl_param,
-			   obj->type);
+			   obj ? obj->type : -1);
 
 	kfree(obj);