From patchwork Thu Feb 28 17:34:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 10833527 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 46F1815AC for ; Thu, 28 Feb 2019 17:38:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BEB62F431 for ; Thu, 28 Feb 2019 17:38:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1FD912F59F; Thu, 28 Feb 2019 17:38:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 055CD2F431 for ; Thu, 28 Feb 2019 17:38:25 +0000 (UTC) Received: from localhost ([127.0.0.1]:43717 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzPdY-0007Vz-9U for patchwork-qemu-devel@patchwork.kernel.org; Thu, 28 Feb 2019 12:38:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzPaV-000683-IH for qemu-devel@nongnu.org; Thu, 28 Feb 2019 12:35:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzPaU-0003dt-RX for qemu-devel@nongnu.org; Thu, 28 Feb 2019 12:35:15 -0500 Received: from smtp03.citrix.com ([162.221.156.55]:52020) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gzPaU-0003KN-I6 for qemu-devel@nongnu.org; Thu, 28 Feb 2019 12:35:14 -0500 X-IronPort-AV: E=Sophos;i="5.58,423,1544486400"; d="scan'208";a="79361355" From: Anthony PERARD To: Date: Thu, 28 Feb 2019 17:34:37 +0000 Message-ID: <20190228173439.8013-3-anthony.perard@citrix.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190228173439.8013-1-anthony.perard@citrix.com> References: <20190228173439.8013-1-anthony.perard@citrix.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 162.221.156.55 Subject: [Qemu-devel] [PULL 2/4] xen-block: remove redundant assignment X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: xen-devel@lists.xenproject.org, Peter Maydell Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Paul Durrant The assignment to 'p' is unnecessary as the code will either goto 'invalid' or p will get overwritten. Spotted by Coverity: CID 1398638 Reported-by: Peter Maydell Signed-off-by: Paul Durrant Acked-by: Anthony PERARD Message-Id: <20190215162533.19475-3-paul.durrant@citrix.com> Signed-off-by: Anthony PERARD --- hw/block/xen-block.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c index 5012af9cb6..29afe2703a 100644 --- a/hw/block/xen-block.c +++ b/hw/block/xen-block.c @@ -413,8 +413,7 @@ static void xen_block_set_vdev(Object *obj, Visitor *v, const char *name, } if (*end == 'p') { - p = (char *) ++end; - if (*end == '\0') { + if (*(++end) == '\0') { goto invalid; } }