mirror of
https://github.com/SCST-project/scst.git
synced 2026-10-22 06:02:33 +00:00
scst_event: Trace the event request being freed
Coccinelle iterators/use_after_iter.cocci reports the following diagnostic in scst_event_disallow_event (message wrapped): scst/src/scst_event.c:750:38-39: ERROR: invalid reference to the index variable of the iterator on line 731 After the disallow loop, e is the exhausted list iterator. The following TRACE_MEM uses e even though the allocation about to be freed is event_entry. Log event_entry instead so the trace names the allocation passed to kfree immediately afterwards. This fixes the diagnostic and the misleading trace address; the lookup, list removal and allocation lifetime are unchanged.
This commit is contained in:
@@ -747,7 +747,7 @@ static int scst_event_disallow_event(struct scst_event_priv *priv, void __user *
|
||||
res = 0;
|
||||
}
|
||||
|
||||
TRACE_MEM("Deleting event entry %p", e);
|
||||
TRACE_MEM("Deleting event entry %p", event_entry);
|
||||
kfree(event_entry);
|
||||
|
||||
out:
|
||||
|
||||
Reference in New Issue
Block a user