asus-wmi: potential NULL dereference in show_call()
PATCH 2/2 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.
---
Can obj actually be NULL here? Perhaps a better fix would be to remove the first check.
drivers/platform/x86/asus-wmi.c +1 -1
@@ -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);
Quoted 8 lines · Dan Carpenter
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 <[email protected]>---
Can obj actually be NULL here? Perhaps a better fix would be to remove the first check.
Yes I think it can.
Quoted 10 lines
drivers/platform/x86/asus-wmi.c +0
-0@@ -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);
Seems ok, I may change that later if we need to support more types.
Signature · 2 lines
Corentin Chary http://xf.iksaif.net