From nobody Wed May 1 21:03:50 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=canonical.com ARC-Seal: i=1; a=rsa-sha256; t=1573474929; cv=none; d=zoho.com; s=zohoarc; b=molWgmq1qlG4fOACeVf/808oXeSb39xlELJEA5HauErbFqgo5j9VPJWx5m0aFOi6X1R9BK/sOSb/KiCWA7OlrWyixxfVmX2Gi0i+rhfacB7D16G1SPoDBWqG281oP5DgzcIblnb1eyHqeiikrIjLpB3em1C7ddw7XJB/h3jpkMs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573474929; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=uJX5MJtbzaXzfy5D0FdcTYoQHlKAUsJ8/B+QvjDViis=; b=BUiFPtplf5AhkLop5ExKjCwiVrtHqwOs+05CCXK3/UQpzYMTmUUqGzKAiJIyzUZ07OFwsO7Pa+XJWUeuHI7JKxWMgiXTfR3GmE33hlxXh4KS8EE82SEj8epA+ULUaGruiN6lJraMZVKffsqzTs4AbAzDnHU4YQOCNAT2fzGK3QQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1573474929713212.77055484661173; Mon, 11 Nov 2019 04:22:09 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iU8g8-0007aM-NR; Mon, 11 Nov 2019 12:20:20 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iU8g7-0007aH-Az for xen-devel@lists.xenproject.org; Mon, 11 Nov 2019 12:20:19 +0000 Received: from youngberry.canonical.com (unknown [91.189.89.112]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 9f9f21d2-047d-11ea-a20c-12813bfff9fa; Mon, 11 Nov 2019 12:20:18 +0000 (UTC) Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iU8fx-0008Et-PF; Mon, 11 Nov 2019 12:20:09 +0000 X-Inumbo-ID: 9f9f21d2-047d-11ea-a20c-12813bfff9fa From: Colin King To: Boris Ostrovsky , Juergen Gross , Stefano Stabellini , xen-devel@lists.xenproject.org Date: Mon, 11 Nov 2019 12:20:09 +0000 Message-Id: <20191111122009.67789-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH][next] xen/gntdev: remove redundant non-zero check on ret X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Colin Ian King The non-zero check on ret is always going to be false because ret was initialized as zero and the only place it is set to non-zero contains a return path before the non-zero check. Hence the check is redundant and can be removed. Addresses-Coverity: ("Logically dead code") Signed-off-by: Colin Ian King --- drivers/xen/gntdev.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index 10cc5e9e612a..07d80b176118 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c @@ -524,11 +524,6 @@ static int gntdev_open(struct inode *inode, struct fil= e *flip) } #endif =20 - if (ret) { - kfree(priv); - return ret; - } - flip->private_data =3D priv; #ifdef CONFIG_XEN_GRANT_DMA_ALLOC priv->dma_dev =3D gntdev_miscdev.this_device; --=20 2.20.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel