Re: [PATCH 25/52] do_new_mount_rc(): use __free() to deal with dropping mnt on failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 25, 2025 at 03:29:33PM +0200, Christian Brauner wrote:
> > -	mnt = vfs_create_mount(fc);
> > +	struct vfsmount *mnt __free(mntput) = vfs_create_mount(fc);
> 
> Ugh, can we please not start declaring variables in the middle of a
> scope.

Seeing that it *is* the beginning of its scope, what do you suggest?
Declaring it above, initializing with NULL and reassigning here?
That's actually just as wrong, if not more so - any assignment added
to it at earlier point and you've got a silent leak, so verifying
correctness would be harder that way.




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux