linux: libzfs: mount: fix uninitialised flags

They're later |=d with constants, but never reset

Caught by valgrind while investigating
https://github.com/openzfs/zfs/pull/12928#issuecomment-1007496550

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12954
This commit is contained in:
наб 2022-01-13 20:07:54 +01:00 committed by Tony Hutter
parent 36a91d6cef
commit c9c9d634aa
1 changed files with 1 additions and 1 deletions

View File

@ -327,7 +327,7 @@ do_mount(zfs_handle_t *zhp, const char *mntpt, char *opts, int flags)
if (!libzfs_envvar_is_set("ZFS_MOUNT_HELPER")) { if (!libzfs_envvar_is_set("ZFS_MOUNT_HELPER")) {
char badopt[MNT_LINE_MAX] = {0}; char badopt[MNT_LINE_MAX] = {0};
unsigned long mntflags = flags, zfsflags; unsigned long mntflags = flags, zfsflags = 0;
char myopts[MNT_LINE_MAX] = {0}; char myopts[MNT_LINE_MAX] = {0};
if (zfs_parse_mount_options(opts, &mntflags, if (zfs_parse_mount_options(opts, &mntflags,