From patchwork Fri May 18 18:17:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 136359 Delivered-To: patches@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1558694lji; Fri, 18 May 2018 11:17:22 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqHeaiOtHRPySU6cXqx9eSvYT8tIb4E6tXjYpPXDSCbq39c3eRgwF3pPehY8wyVNNSS+9RC X-Received: by 2002:a1c:4406:: with SMTP id r6-v6mr4893755wma.99.1526667442759; Fri, 18 May 2018 11:17:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526667442; cv=none; d=google.com; s=arc-20160816; b=wPHGm+zTxG/Jz4/GWjFIMhX3zTi/XQ72lB1Rss0KeLejd8O4YFq6hFtvn637BCjCO+ 00cNMtYywLybDgvmLRE+LQqh6mdb1/11BNc81Azp0O+HSr+eCU1xwxS/vlSORmjI0amo +6WID/XPbmhQ0sVnFnmRKZ/A488PtYNLRyaY1lMUCx3IF31TP/NFNi11Wd1PIn2DFh3t bbzyfz1ClHQJOLIN0QhqpUlJr9QFkm7hevUpAovAm10arIBsEmRan4crNyaG4tBcL+6d N/w6GKZ4/cXB5sEFi76qPc3cy0GhH9u08paKuIIX521WEz7IDiBFUxeaO6OAxowSaFJU P4UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=G4TLlBJcr+hc5IluGY9BhgxzXF5hP58+s+vWpojbJfw=; b=O+fqm3IDwLna+c8/5+qbzWCqSVmirG7jrTjEMmOkcPVJRtzYaV7Kr8ED36I1Z4Msey NXSR/Y9FOA4eg1ZXRblH6E7YhS4/UYKP8ZmLQmeZMioK3MPRXEW2LRPKRwFAG9YYE6XR fqhsycAUyn9m9fYPFoLhwJ3B1p0tqXVCtiBuNBRbhz8nLLiV3vnOsYJiYLufl0Y6U8r9 ABWr/OzWnAVmTCouin83dqeJfXIGkqlti7ahrTOnhwyfSfXizB4hlJJJd4/4W688o06i YfwpTQIwuolUSiKg4gBLPAVWx4kQD3npDuOMvTrhsZQP03yj4pAmzEyRKdDOQ2WhzHrO EJfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id 129-v6si6015257wmm.225.2018.05.18.11.17.22 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 May 2018 11:17:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 Cc: patches@linaro.org, Hitoshi Mitake , Liu Yuan , Jeff Cody , Kevin Wolf , Max Reitz , qemu-block@nongnu.org, sheepdog@lists.wpkg.org Subject: [PATCH] sheepdog: Remove unnecessary NULL check in sd_prealloc() 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 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(-) -- 2.17.0 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;