Skip to content

Commit

Permalink
objtool: Fix seg fault caused by missing parameter
Browse files Browse the repository at this point in the history
Fix a seg fault when no parameter is provided to 'objtool orc'.

Signed-off-by: Simon Ser <[email protected]>
Signed-off-by: Josh Poimboeuf <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/9172803ec7ebb72535bcd0b7f966ae96d515968e.1514666459.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
emersion authored and Ingo Molnar committed Dec 30, 2017
1 parent e7e83dd commit d89e426
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/objtool/builtin-orc.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ int cmd_orc(int argc, const char **argv)
const char *objname;

argc--; argv++;
if (argc <= 0)
usage_with_options(orc_usage, check_options);

if (!strncmp(argv[0], "gen", 3)) {
argc = parse_options(argc, argv, check_options, orc_usage, 0);
if (argc != 1)
Expand All @@ -52,7 +55,6 @@ int cmd_orc(int argc, const char **argv)
objname = argv[0];

return check(objname, no_fp, no_unreachable, true);

}

if (!strcmp(argv[0], "dump")) {
Expand Down

0 comments on commit d89e426

Please sign in to comment.