Skip to content

Commit 37f31b6

Browse files
ubifs: Check for name being NULL while mounting
The requested device name can be NULL or an empty string. Check for that and refuse to continue. UBIFS has to do this manually since we cannot use mount_bdev(), which checks for this condition. Fixes: 1e51764 ("UBIFS: add new flash file system") Reported-by: [email protected] Signed-off-by: Richard Weinberger <[email protected]>
1 parent ae596de commit 37f31b6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/ubifs/super.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,6 +1954,9 @@ static struct ubi_volume_desc *open_ubi(const char *name, int mode)
19541954
int dev, vol;
19551955
char *endptr;
19561956

1957+
if (!name || !*name)
1958+
return ERR_PTR(-EINVAL);
1959+
19571960
/* First, try to open using the device node path method */
19581961
ubi = ubi_open_volume_path(name, mode);
19591962
if (!IS_ERR(ubi))

0 commit comments

Comments
 (0)