浏览代码

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>
Dan Carpenter 14 年之前
父节点
当前提交
a1d6086739
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/platform/x86/asus-wmi.c

+ 1 - 1
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);