Re: [PATCH v6.13] fs/netfs/read_collect: fix crash due to uninitialized `prev` variable

From: Max Kellermann
Date: Fri Feb 14 2025 - 08:14:47 EST


On Fri, Feb 14, 2025 at 2:03 PM David Howells <dhowells@xxxxxxxxxx> wrote:
>
> Max Kellermann <max.kellermann@xxxxxxxxx> wrote:
>
> > prev = list_prev_entry(subreq, rreq_link);
> > ...
> > + if (subreq->start == prev->start + prev->len) {
> > + prev = list_prev_entry(subreq, rreq_link);
>
> Actually, that doubles the setting of prev redundantly. It shouldn't hurt,
> but we might want to remove the inner one.

Oh right, that line shouldn't exist twice. (Previously, it was set too
late, after the variable had already been dereferenced.) I'll send v2
with only one copy.