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:
Gleb Chesnokov
2026-10-20 18:02:29 +03:00
parent 337a387bbd
commit de2cd0960c
+1 -1
View File
@@ -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: