Skip to content

Commit 94c41b3

Browse files
thehajimerichardweinberger
authored andcommitted
um: ubd: fix command line handling of ubd
This commit fixes a regression to handle command line parameters of ubd. With a simple line "./linux ubd0="./disk-ext4.img", it fails at ubd_setup_common(). The commit adds additional checks to the variables in order to properly parse the paremeters which previously worked. Fixes: ef3ba87 ("um: ubd: Set device serial attribute from cmdline") Cc: Christopher Obbard <chris.obbard@collabora.com> Signed-off-by: Hajime Tazaki <thehajime@gmail.com> Acked-by: Christopher Obbard <chris.obbard@collabora.com> Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent 4992eb4 commit 94c41b3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/um/drivers/ubd_kern.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,11 +375,11 @@ static int ubd_setup_common(char *str, int *index_out, char **error_out)
375375
file = NULL;
376376

377377
backing_file = strsep(&str, ",:");
378-
if (*backing_file == '\0')
378+
if (backing_file && *backing_file == '\0')
379379
backing_file = NULL;
380380

381381
serial = strsep(&str, ",:");
382-
if (*serial == '\0')
382+
if (serial && *serial == '\0')
383383
serial = NULL;
384384

385385
if (backing_file && ubd_dev->no_cow) {

0 commit comments

Comments
 (0)