lkml.org 
[lkml]   [2022]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH V4 01/20] rv: Add Runtime Verification (RV) interface
From
Hey Tao!

On 7/6/22 19:49, Tao Zhou wrote:
>> +static void *enabled_monitors_start(struct seq_file *m, loff_t *pos)
>> +{
>> + struct rv_monitor_def *m_def;
>> + loff_t l;
>> +
>> + mutex_lock(&rv_interface_lock);
>> + m_def = list_entry(&rv_monitors_list, struct rv_monitor_def, list);
> I realized this m_def is not real but vain. Is it possible the loop is
> skiped and just return m_def that is not valid.

that is empty... not a problem.

I am not seeing (the possible) problem here. Could you simulate/reproduce the problem?

Btw, this code is "inspired" (iow stolen) from trace_events.c.

Am I missing something? steve?

>> + for (l = 0; l <= *pos; ) {
>> + m_def = enabled_monitors_next(m, m_def, &l);
>> + if (!m_def)
>> + break;
>> + }
>> +
>> + return m_def;
>> +}

-- Daniel

\
 
 \ /
  Last update: 2022-07-08 16:40    [W:0.115 / U:0.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site