Re: [PATCH] smb: client: fix sbflags initialization
Steve French <[email protected]> Sat, 7 Mar 2026 21:15:58 -0600
| Newsgroups | gmane.linux.kernel,gmane.linux.kernel.cifs,gmane.network.samba.internals |
|---|---|
| Message-ID | <CAH2r5muoUuTMOFMe0RrvQugUy0uw05+9H0bKJr0sG6Z1HL0xJQ@mail.gmail.com> |
Good catch. Added the Reviewed-by and merged into cifs-2.6.git for-next On Fri, Mar 6, 2026 at 9:17 AM Paulo Alcantara <[email protected]> wrote: > > Arnd Bergmann <[email protected]> writes: > > > From: Arnd Bergmann <[email protected]> > > > > The newly introduced variable is initialized in an #ifdef block > > but used outside of it, leading to undefined behavior when > > CONFIG_CIFS_ALLOW_INSECURE_LEGACY is disabled: > > > > fs/smb/client/dir.c:417:9: error: variable 'sbflags' is uninitialized when used here [-Werror,-Wuninitialized] > > 417 | if (sbflags & CIFS_MOUNT_DYNPERM) > > | ^~~~~~~ > > > > Move the initialization into the declaration, the same way as the > > other similar function do it. > > > > Fixes: 4fc3a433c139 ("smb: client: use atomic_t for mnt_cifs_flags") > > Signed-off-by: Arnd Bergmann <[email protected]> > > --- > > fs/smb/client/dir.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > Reviewed-by: Paulo Alcantara (Red Hat) <[email protected]> > -- Thanks, Steve