Commit 64019243 authored by Randy Dunlap's avatar Randy Dunlap Committed by Greg Kroah-Hartman

dynamic-debug-howto: fix optional/omitted ending line number to be LARGE instead of 0


[ Upstream commit 1f3c790b ]

line-range is supposed to treat "1-" as "1-endoffile", so
handle the special case by setting last_lineno to UINT_MAX.

Fixes this error:

  dynamic_debug:ddebug_parse_query: last-line:0 < 1st-line:1
  dynamic_debug:ddebug_exec_query: query parse failed

Link: http://lkml.kernel.org/r/10a6a101-e2be-209f-1f41-54637824788e@infradead.orgSigned-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Acked-by: default avatarJason Baron <jbaron@akamai.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 24c98ec4
...@@ -353,6 +353,10 @@ static int ddebug_parse_query(char *words[], int nwords, ...@@ -353,6 +353,10 @@ static int ddebug_parse_query(char *words[], int nwords,
if (parse_lineno(last, &query->last_lineno) < 0) if (parse_lineno(last, &query->last_lineno) < 0)
return -EINVAL; return -EINVAL;
/* special case for last lineno not specified */
if (query->last_lineno == 0)
query->last_lineno = UINT_MAX;
if (query->last_lineno < query->first_lineno) { if (query->last_lineno < query->first_lineno) {
pr_err("last-line:%d < 1st-line:%d\n", pr_err("last-line:%d < 1st-line:%d\n",
query->last_lineno, query->last_lineno,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment