public inbox for linux-um@lists.infradead.org
 help / color / mirror / Atom feed
From: Hajime Tazaki <thehajime@gmail.com>
To: linux-um@lists.infradead.org, jdike@addtoit.com, richard@nod.at,
	anton.ivanov@cambridgegreys.com
Cc: Hajime Tazaki <thehajime@gmail.com>,
	Christopher Obbard <chris.obbard@collabora.com>
Subject: [PATCH] um: ubd: fix command line handling of ubd
Date: Mon, 21 Dec 2020 11:24:34 +0900	[thread overview]
Message-ID: <20201221022434.21725-1-thehajime@gmail.com> (raw)

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: ef3ba87cb7c9 ("um: ubd: Set device serial attribute from
cmdline")
Cc: Christopher Obbard <chris.obbard@collabora.com>
Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
---
 arch/um/drivers/ubd_kern.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 13b1fe694b90..bd16b17ba4d6 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -375,11 +375,11 @@ static int ubd_setup_common(char *str, int *index_out, char **error_out)
 		file = NULL;
 
 	backing_file = strsep(&str, ",:");
-	if (*backing_file == '\0')
+	if (backing_file && *backing_file == '\0')
 		backing_file = NULL;
 
 	serial = strsep(&str, ",:");
-	if (*serial == '\0')
+	if (serial && *serial == '\0')
 		serial = NULL;
 
 	if (backing_file && ubd_dev->no_cow) {
-- 
2.17.2


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


             reply	other threads:[~2020-12-21  2:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-21  2:24 Hajime Tazaki [this message]
2020-12-22 11:49 ` [PATCH] um: ubd: fix command line handling of ubd Christopher Obbard
2020-12-23 10:19   ` Richard Weinberger
2021-01-04 10:56     ` Christopher Obbard
2021-01-04 11:18       ` Richard Weinberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201221022434.21725-1-thehajime@gmail.com \
    --to=thehajime@gmail.com \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=chris.obbard@collabora.com \
    --cc=jdike@addtoit.com \
    --cc=linux-um@lists.infradead.org \
    --cc=richard@nod.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox