Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit d89e426

Browse files
emersionIngo Molnar
authored andcommitted
objtool: Fix seg fault caused by missing parameter
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]>
1 parent e7e83dd commit d89e426

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/objtool/builtin-orc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ int cmd_orc(int argc, const char **argv)
4444
const char *objname;
4545

4646
argc--; argv++;
47+
if (argc <= 0)
48+
usage_with_options(orc_usage, check_options);
49+
4750
if (!strncmp(argv[0], "gen", 3)) {
4851
argc = parse_options(argc, argv, check_options, orc_usage, 0);
4952
if (argc != 1)
@@ -52,7 +55,6 @@ int cmd_orc(int argc, const char **argv)
5255
objname = argv[0];
5356

5457
return check(objname, no_fp, no_unreachable, true);
55-
5658
}
5759

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

0 commit comments

Comments
 (0)