9
0
Fork 0

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:
Lucas Stach 2016-07-06 21:32:48 +02:00 committed by Sascha Hauer
parent 6974c69d06
commit 435ec2679e
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ static int do_menu_entry_add(struct cmd_menu *cm)
else
me = menu_add_command_entry(m, cm->description, cm->command,
cm->type);
if (!me)
if (IS_ERR(me))
return PTR_ERR(me);
me->box_state = cm->box_state > 0 ? 1 : 0;