From patchwork Mon Dec 21 02:24:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hajime Tazaki X-Patchwork-Id: 1418865 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=dakl0ke8; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=VErm4/Am; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Czjwt3mf5z9sVk for ; Mon, 21 Dec 2020 13:25:02 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=Cx6tATXIWiyBcsiUgy/Mlu07S9GNeJWxCllBxMU9tKM=; b=dakl0ke8VOJoK1YtyPYrHEoL7N bTvbl6E+Ei5Q1Yy6A6kvE5pNFGtsEEyrFVAAmoTBuP7DlCe12Y+9oUxdkOcCP+oy3Hzo32qzrIbpd NFJqRVnwPPk/L04uvuLREfvgoXKiLEGELvGPambM8oUFne/UjUpKY7GNluF+5PektpcqTOrcS9hXE qGRVrYJSTnDy23nUdfNLkCBIjODYMFpnMbc6SLEARqrVVZPhklBDOk/2efJZS0WKBHWVnVn+aIjZV r0z8RWYCypMwhjRi+h1SrP9cTnb3zj+XvN0zBblxrHbTSH7bIHK/nbNF0oOV3jkQtZaaN6wXb7/Jm C3uCDjvw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1krAsT-0005NI-7S; Mon, 21 Dec 2020 02:24:49 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1krAsQ-0005MH-Pn for linux-um@lists.infradead.org; Mon, 21 Dec 2020 02:24:47 +0000 Received: by mail-pl1-x62a.google.com with SMTP id g3so4853429plp.2 for ; Sun, 20 Dec 2020 18:24:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XiE16a4FS8dQE19lNzqYsdvKLaBjIY72NxlFkG8EBs4=; b=VErm4/AmFoA1+ls8g4eJ22HOl9exN4h7b2SA4/BkWnmWoArk31oqLmQ59G3ZNEYKAy BPiWLkORhk7hBHHWPNq/M+B+Ds9HEz+r+H0BLAsJq0rwJ7mpNE2b/NiczIZ9O78oFHhr TzY2NiGE6osei76OnliLK6tI2lifc3yaY01HvEiTq7FtThFBRn+xDBH7eYTHVXa00AKH 8uvyi3G/kScaElTPloycJ8uDnzElvgeEflUf15zF+NdfVRtI3T+fkzfwPS8VLiADTmjO +lrozgf1HbbB0RNTHvf5Va61CqfHuVM3O8dpUWLGvzoy9qbtCGITrFu3KBnO8NcvuH// eJvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XiE16a4FS8dQE19lNzqYsdvKLaBjIY72NxlFkG8EBs4=; b=K3m+qAveXWtXz18dSrkO0tXEHfcTQHvFzrN5DaERsgRWq3uPlVWGWsmKNij6vMOuLL Yr8U1fuAnz2CBlRnvnkrjmprFtOURUgzgGxKJNAUoXlyy9CEdf8f6w38OBjG2wNoaPbo r1/7E+GF15H54dvHRXkaZdr8bLvBkgg0jNRj4lCtSFRdIaTlUnHQVIqL/MtH0DDL66rV +JTjL7FfBDHhsHGCA6mv8Pt+ILhNe6grL5URXS8lq2J+fHV+HIhzFvVTTYeHS7rIwXtL 3Hvv6vKPsCrb7vyte8fpGFrMJPQvMSTMmxvEWvtYbS98liPV0HfxXavbq7osDdlYieOg pFgA== X-Gm-Message-State: AOAM531TGOZlprM0fW9VB6qb9y+ZeKa9bwHUNRJo4tDbi+FUNQq6jv6+ VkqE/OP+++qT4HAf3hJPD6Q= X-Google-Smtp-Source: ABdhPJzgrtkbCSiw9madJ+0dbWNdU4c5mXtbjeQ6q7jN+T5YZq3j9BaZt5M/ZD9htAdjNA/2XGsCtg== X-Received: by 2002:a17:90a:5405:: with SMTP id z5mr15557203pjh.13.1608517483410; Sun, 20 Dec 2020 18:24:43 -0800 (PST) Received: from earth-mac.local (219x123x138x129.ap219.ftth.ucom.ne.jp. [219.123.138.129]) by smtp.gmail.com with ESMTPSA id gj1sm13398660pjb.11.2020.12.20.18.24.42 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Dec 2020 18:24:42 -0800 (PST) Received: by earth-mac.local (Postfix, from userid 501) id 8D035204166667; Mon, 21 Dec 2020 11:24:39 +0900 (JST) From: Hajime Tazaki To: linux-um@lists.infradead.org, jdike@addtoit.com, richard@nod.at, anton.ivanov@cambridgegreys.com Subject: [PATCH] um: ubd: fix command line handling of ubd Date: Mon, 21 Dec 2020 11:24:34 +0900 Message-Id: <20201221022434.21725-1-thehajime@gmail.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122.2) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201220_212446_922023_4B5F8DB1 X-CRM114-Status: GOOD ( 12.00 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62a listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [thehajime[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hajime Tazaki , Christopher Obbard Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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 Signed-off-by: Hajime Tazaki Acked-by: Christopher Obbard --- 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) {