[lvc-project] [PATCH v2] net: 9p: avoid freeing uninit memory in p9pdu_vreadf
Dominique Martinet
asmadeus at codewreck.org
Tue Dec 5 15:43:32 MSK 2023
Fedor Pchelkin wrote on Tue, Dec 05, 2023 at 03:15:43PM +0300:
> As for the second initialization (the one located after kfree(*wnames) in
> error handling path - it was there all the time), I think it's better not
> to touch it. I've just moved kfree and null-assignment under
> 'if (*wnames)' statement.
Ah, I somehow missed this was just moved; that doesn't change anything
but doesn't hurt either, sure.
> The concern you mentioned is about any user that'd ignore the return code
> and try to use *wnames (so that the second initialization makes some
> sense). I can't see if there is any such user but, as said before, it's
> better not to touch that code.
Yes, it was here before, let's leave it in.
> > I don't mind the change even if there isn't but let's add a word in the
> > commit message.
>
> OK, will do in v3.
I've queued to -next as is (with the i initialized as Christian pointed
out), will update if you send a new one later.
Thanks,
--
Dominique Martinet | Asmadeus
More information about the lvc-project
mailing list