commands: menu: check return pointer properly
The called functions return error codes encoded in the pointer, so the NULL check will never be true. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
6974c69d06
commit
435ec2679e
1 changed files with 1 additions and 1 deletions
|
@ -83,7 +83,7 @@ static int do_menu_entry_add(struct cmd_menu *cm)
|
||||||
else
|
else
|
||||||
me = menu_add_command_entry(m, cm->description, cm->command,
|
me = menu_add_command_entry(m, cm->description, cm->command,
|
||||||
cm->type);
|
cm->type);
|
||||||
if (!me)
|
if (IS_ERR(me))
|
||||||
return PTR_ERR(me);
|
return PTR_ERR(me);
|
||||||
|
|
||||||
me->box_state = cm->box_state > 0 ? 1 : 0;
|
me->box_state = cm->box_state > 0 ? 1 : 0;
|
||||||
|
|
Loading…
Reference in a new issue