summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Stach <dev@lynxeye.de>2016-07-06 21:32:48 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-07-07 09:44:32 +0200
commit435ec2679e4d1bd500b6f1b357392d16e0592f28 (patch)
tree57b6a431ce5d771aed98a4815112f361e9b8f43a
parent6974c69d06235eb3908af5360e271ce0ef186379 (diff)
downloadbarebox-435ec2679e4d1bd500b6f1b357392d16e0592f28.tar.gz
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>
-rw-r--r--commands/menu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/menu.c b/commands/menu.c
index 9ec2d57..e1079fd 100644
--- a/commands/menu.c
+++ b/commands/menu.c
@@ -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;