Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5b78f83 authored by Jim Cromie's avatar Jim Cromie Committed by Greg Kroah-Hartman
Browse files

dynamic_debug: early return if _ddebug table is empty



If _ddebug table is empty (in a CONFIG_DYNAMIC_DEBUG build this
shouldn't happen), then warn (error?) and return early.  This skips
empty table scan and parsing of setup-string, including the pr_info
call noting the parse.  By inspection, copy return-code handling from
1st ddebug_add_module() callsite to 2nd.

Signed-off-by: default avatarJim Cromie <jim.cromie@gmail.com>
Signed-off-by: default avatarJason Baron <jbaron@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 820874c7
Loading
Loading
Loading
Loading
+20 −15
Original line number Diff line number Diff line
@@ -871,7 +871,11 @@ static int __init dynamic_debug_init(void)
	int ret = 0;
	int n = 0;

	if (__start___verbose != __stop___verbose) {
	if (__start___verbose == __stop___verbose) {
		pr_warn("_ddebug table is empty in a "
			"CONFIG_DYNAMIC_DEBUG build");
		return 1;
	}
	iter = __start___verbose;
	modname = iter->modname;
	iter_start = iter;
@@ -887,7 +891,8 @@ static int __init dynamic_debug_init(void)
		n++;
	}
	ret = ddebug_add_module(iter_start, n, modname);
	}
	if (ret)
		goto out_free;

	/* ddebug_query boot param got passed -> set it up */
	if (ddebug_setup_string[0] != '\0') {