Received: by 10.223.176.5 with SMTP id f5csp636932wra; Sat, 27 Jan 2018 06:58:31 -0800 (PST) X-Google-Smtp-Source: AH8x226v5VJdrr2NPrSTV1PtrC0R3lKqRDX8GqVfMG/RldE/dyAm4ciPwmdx/R07AJny/W4afe4d X-Received: by 10.101.80.69 with SMTP id k5mr6816117pgo.439.1517065111304; Sat, 27 Jan 2018 06:58:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517065111; cv=none; d=google.com; s=arc-20160816; b=fgtJM5qFRHMPRaMUWqr/lgLvY+KqybieCuP4QNNIaLmatN5hDG9ju8/uJcyDFSIvdz DNNAkrVSnXSy3VaStINS6cSWVtHDid1hFF7UxmvH1GKZARp/iPrQqYa7mxLCcnlnmgGF XonxiwpeFlNaQsN8KOJM3b4OIeMaLWfQCRRo7uV2U+nGvdmzj9L78f6uJBNwowrtDUxx Rp67feW2+cfnliVaNk9XGALr5lzjTutvmiHmAvturbnG8ayA237ENRerrOLcwbu5M/QN wWSFfmwaigKO1NV5Z79oab4xGf87L422W0rBHL6bMH5IqgSR2ruKw6aIaamrhPywMPjO cIEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=r6vFVkzka7thRyv0CWg0oC7kNA9S2BmR8h8+eQiiXDk=; b=PrtbJ1hQ168Lae3hylX4glCvnnNG2APYij4ONG/fQP4KnoHLtLFFsknIbXhXs+7lSq vzN48UWlL4IU3z6MBn29UbaScMw8ua9NwUkx+DphA+MC6lBsNubNsU3H063vHKXVMqrR 6IEhSG/X8n255sXzNEp9peB0d/Pz0ehQitu5WPi+jTsvuVXkFQ2PBCrROZpmmqsbMuaK LiFSgv1pIwViiTj5A2hueNC6XUDbLpK5vA5PjhhUKsZ7sV1i4reG9/Pn0yzf7P8NWSBS HCnNPU9LksQHV0aPezcF3NZ6v9KRP/KFDgcILjLP+N3Di5aKKzxtkBDBVMHHHPG9Yc7U ns0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r63-v6si4793434plb.788.2018.01.27.06.58.17; Sat, 27 Jan 2018 06:58:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753089AbeA0O5j (ORCPT + 99 others); Sat, 27 Jan 2018 09:57:39 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:41774 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753062AbeA0O5i (ORCPT ); Sat, 27 Jan 2018 09:57:38 -0500 X-IronPort-AV: E=Sophos;i="5.46,422,1511823600"; d="scan'208";a="252687979" Received: from palace.lip6.fr (HELO localhost.localdomain) ([132.227.105.202]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/AES128-SHA256; 27 Jan 2018 15:57:36 +0100 From: Julia Lawall To: Thierry Reding Cc: kernel-janitors@vger.kernel.org, Jonathan Hunter , linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] firmware: tegra: adjust tested variable Date: Sat, 27 Jan 2018 15:28:28 +0100 Message-Id: <1517063308-16679-1-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Check the variable that was most recently initialized. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression x, y, f, g, e, m; statement S1,S2,S3,S4; @@ x = f(...); if (\(<+...x...+>\&e\)) S1 else S2 ( x = g(...); | m = g(...,&x,...); | y = g(...); *if (e) S3 else S4 ) // Signed-off-by: Julia Lawall --- drivers/firmware/tegra/bpmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/tegra/bpmp.c b/drivers/firmware/tegra/bpmp.c index a7f461f..96362b5 100644 --- a/drivers/firmware/tegra/bpmp.c +++ b/drivers/firmware/tegra/bpmp.c @@ -732,7 +732,7 @@ static int tegra_bpmp_probe(struct platform_device *pdev) } bpmp->rx.virt = gen_pool_dma_alloc(bpmp->rx.pool, 4096, &bpmp->rx.phys); - if (!bpmp->rx.pool) { + if (!bpmp->rx.virt) { dev_err(&pdev->dev, "failed to allocate from RX pool\n"); err = -ENOMEM; goto free_tx;