From patchwork Wed May 23 13:11:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 136649 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp888050lji; Wed, 23 May 2018 06:19:27 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLvIBjHzSeZ9z/JuUAqEUilgYLk7NC56a3Of3dsL8860M+mBHwf+ZjWbMnMtz/TCsT5slDO X-Received: by 2002:a37:b743:: with SMTP id h64-v6mr2404053qkf.84.1527081567801; Wed, 23 May 2018 06:19:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527081567; cv=none; d=google.com; s=arc-20160816; b=Ed3a8YpTQrNXfFuZlzdr3pLBOgGZbt8Oskk0BGM60PNh8KvPUx+NkHunp36kQuRuG5 VgKdddkq6JE/sikgq65Euftb9BHYGl6JIh1SgaNDfsKRGQY7qcjefa2Nogyj0BwGFe2f G9uGRLOds71LIBzgStXIaOge4Q9Ud4AoWFQmmjdB0NsOYsTNhX8RN06JojPbII+NfYgf TY6jUcs8zoJFCtx1m47peGlmybi2q6oH4W+tj1b1IgSl205vHFT+rR9SZTFFg1I9DTVQ o1iT/FaltchW0iGY/l3uhbltxPn+riz2qStDYN4tMGHofsWJTd3t3iCqRq+PcHyseGFU oUMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=bgUtM8o925Gd6TyY/CQ524MdoYviQjLcO6QeVY3CYWA=; b=OK/VKROatBhx7ETU/iFxfBBhxzfjGXTrmYnsXNrdQKnERhXoPI/SmldrdBmaO1iTUb wxOn2Sd6F7ivObFSkuek8ty1EtIztPmR72p1w0ktdg/1mMGn59GSvU4b3Ag9HoRX5bLX kYgBgqd6wmsz+7n5pgnFLluY3NOFYXU7l1TOwUIsyj0k/AwpRKdzdYmPbz8CY9POtwy2 ecp6DWJWJfJjIAs2Wfd6To9x5l5PZ9EXU8asOu3NVVzYvctiOWLqtJ1asY6NoJ5Ve+aO v4oHMBG+YO2jlt0iffERtWTDZZfUWDEOISCVL3LxVmL/mhUdwVqW0DLaBB5JnclLzpbp /eSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id m42-v6si6997881qvm.81.2018.05.23.06.19.27 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 23 May 2018 06:19:27 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:33318 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLTfr-00069x-7H for patch@linaro.org; Wed, 23 May 2018 09:19:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLTYw-0001lw-DH for qemu-devel@nongnu.org; Wed, 23 May 2018 09:12:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLTYt-0006tY-K9 for qemu-devel@nongnu.org; Wed, 23 May 2018 09:12:18 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36054 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fLTYi-0006me-PO; Wed, 23 May 2018 09:12:04 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5C39F40711C1; Wed, 23 May 2018 13:12:04 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.36.118.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id AE20385786; Wed, 23 May 2018 13:12:03 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Wed, 23 May 2018 15:11:13 +0200 Message-Id: <20180523131155.12359-5-kwolf@redhat.com> In-Reply-To: <20180523131155.12359-1-kwolf@redhat.com> References: <20180523131155.12359-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 23 May 2018 13:12:04 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 23 May 2018 13:12:04 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kwolf@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 04/46] sheepdog: Remove unnecessary NULL check in sd_prealloc() 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: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell In commit 8b9ad56e9cbfd852a, we removed the code that could result in our getting to sd_prealloc()'s out_with_err_set label with a NULL blk pointer. That makes the NULL check in the error-handling path unnecessary, and Coverity gripes about it (CID 1390636). Delete the redundant check. Signed-off-by: Peter Maydell Signed-off-by: Kevin Wolf --- block/sheepdog.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.13.6 diff --git a/block/sheepdog.c b/block/sheepdog.c index 4237132419..2a5bc0a59a 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -1859,9 +1859,7 @@ out: error_setg_errno(errp, -ret, "Can't pre-allocate"); } out_with_err_set: - if (blk) { - blk_unref(blk); - } + blk_unref(blk); g_free(buf); return ret;