If I may add a small point, apart from the invariant being kept, initializing on definition also makes bug behavior more deterministic. Hunting for a bug that only manifests on certain uninitialized values in memory is hard.
On Thu, Jan 25, 2024 at 5:32 PM Vladimir 'phcoder' Serbinenko <phco...@gmail.com> wrote: > > I oppose to all 3 patches. These assignments are not redundant but keep an > important invariant: the variable in question can be passed to free(). > For this it needs to either be NULL or point to a valid allocated memory. In > this code this ensures that we never double free even after code changes > > Le sam. 20 janv. 2024, 05:53, Alec Brown <alec.r.br...@oracle.com> a écrit : >> >> Coverity listed three unused value bugs in the GRUB. These patches help clean >> up and remove these uneccessary bits of code. >> >> The Coverity bugs being addressed are: >> CID 428875 >> CID 428876 >> CID 428877 >> >> Alec Brown (3): >> fs/jfs.c: Clean up redundant code >> osdep/unix/getroot.c: Clean up redundant code >> loader/i386/multiboot_mbi.c: Clean up redundant code >> >> grub-core/fs/jfs.c | 1 - >> grub-core/loader/i386/multiboot_mbi.c | 2 +- >> grub-core/osdep/unix/getroot.c | 1 - >> 3 files changed, 1 insertion(+), 3 deletions(-) >> >> >> >> _______________________________________________ >> Grub-devel mailing list >> Grub-devel@gnu.org >> https://lists.gnu.org/mailman/listinfo/grub-devel > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel