From nobody Mon Feb 9 01:28:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1526667578837394.7637490875792; Fri, 18 May 2018 11:19:38 -0700 (PDT) Received: from localhost ([::1]:40380 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJjyV-00080P-VM for importer@patchew.org; Fri, 18 May 2018 14:19:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJjwX-0007CG-2e for qemu-devel@nongnu.org; Fri, 18 May 2018 14:17:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJjwW-0000sY-7V for qemu-devel@nongnu.org; Fri, 18 May 2018 14:17:29 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:41816) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fJjwW-0000ru-0X; Fri, 18 May 2018 14:17:28 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1fJjwM-00050B-Mt; Fri, 18 May 2018 19:17:18 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 18 May 2018 19:17:17 +0100 Message-Id: <20180518181717.6700-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.17.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH] 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: Kevin Wolf , sheepdog@lists.wpkg.org, qemu-block@nongnu.org, patches@linaro.org, Hitoshi Mitake , Jeff Cody , Max Reitz , Liu Yuan Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 --- block/sheepdog.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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); =20 return ret; --=20 2.17.0