Skip to content

Commit 431aa3f

Browse files
Steven RostedtIngo Molnar
authored andcommitted
ftrace: convert unsigned index to signed
Impact: fix to unsigned compared to less than zero Roel Kluin pointed out that there is a compare of an unsigned number to less than zero. A previous clean up had the unsigned index set to -1 for certain cases, but never converted it to signed. Frederic Weisbecker noticed that another index is used to compare the above index to and it also needs to be converted to signed. [ Converted ftrace_page->index to int from unsigned long as Andrew Morton pointed out that there's no need for it to stay a long. ] Reported-by: Roel Kluin <roel.kluin@gmail.com> Reported-by: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 99793e3 commit 431aa3f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎kernel/trace/ftrace.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ static DEFINE_MUTEX(ftrace_regex_lock);
289289

290290
struct ftrace_page {
291291
struct ftrace_page *next;
292-
unsigned long index;
292+
int index;
293293
struct dyn_ftrace records[];
294294
};
295295

@@ -786,7 +786,7 @@ enum {
786786

787787
struct ftrace_iterator {
788788
struct ftrace_page *pg;
789-
unsigned idx;
789+
int idx;
790790
unsigned flags;
791791
unsigned char buffer[FTRACE_BUFF_MAX+1];
792792
unsigned buffer_idx;

0 commit comments

Comments
 (0)