From patchwork Thu Aug 25 21:19:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 9300063 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4A12A607D8 for ; Thu, 25 Aug 2016 21:42:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 394DA293E6 for ; Thu, 25 Aug 2016 21:42:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2DF76293F4; Thu, 25 Aug 2016 21:42:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C2734293E6 for ; Thu, 25 Aug 2016 21:42:09 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bd2OJ-0000gV-Sm; Thu, 25 Aug 2016 21:40:51 +0000 Received: from mail-it0-x22f.google.com ([2607:f8b0:4001:c0b::22f]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bd24L-0006M5-NP for linux-arm-kernel@lists.infradead.org; Thu, 25 Aug 2016 21:20:15 +0000 Received: by mail-it0-x22f.google.com with SMTP id f6so112880765ith.0 for ; Thu, 25 Aug 2016 14:19:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/PEV9UEF9TSl5WtF+CyC7gbSuM3a386tEScTcYXnevo=; b=Ttpkrov626716oIQoqPx/TOcq/7I0DEzv1jZAUFuDqQcx5DqYreT4PmzZu4EnQ8/zO iwOp4QPkLM7jC3sAoZ/0duc4x2akNwoQLJEXf1GJ+LdKWp6BfglFtzPYASBPSSy0SMJB WXTFaBgjKx2BuGtjlCUhgHadhQ1GqkvLAaEZA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/PEV9UEF9TSl5WtF+CyC7gbSuM3a386tEScTcYXnevo=; b=LjA+UzkEIDmIHkCzioML6G5QfKT8WluCMzpFHPivYjWLiTrVffL2YU+BXBLYv2Pj06 JfwNtkKJ5glDuQQbZogyBLpnuGkaT6TcRrIet4XkXRsRZX6of6/8bIH+TN56EB5jMfzf 6uHRWeswbZ2iD/dRAPi9DCpPns2FvyU+hhYU45iCaaNzcHSrek/O1v0Af4jjWSNZ//RW P8YkKsA54G5C27OscTayeawxR6tdlmmmDMMgZWsvBfrY0koBRwu/RuHGhUMmU0H5Zw+P O26hWobCtIwcNKRp5vCC+0gcvJcfJXsI6clkjWSJSOB2uM/Azwic1P8g6vBm6+V8+R56 Lv4Q== X-Gm-Message-State: AE9vXwN53sxFuvYyMpnl9LyRbvnLZdH9zRydVOK/DzG7BDB1FeoHNjY6y/lE5IG/lvqzfStQ X-Received: by 10.36.41.205 with SMTP id p196mr8017876itp.76.1472159993063; Thu, 25 Aug 2016 14:19:53 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id o5sm14506120ith.20.2016.08.25.14.19.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Aug 2016 14:19:52 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 17/28] coresight: tmc: Delete an unnecessary check before the function call "kfree" Date: Thu, 25 Aug 2016 15:19:07 -0600 Message-Id: <1472159958-5981-18-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472159958-5981-1-git-send-email-mathieu.poirier@linaro.org> References: <1472159958-5981-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160825_142013_893562_2A059AE4 X-CRM114-Status: GOOD ( 11.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring The kfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-tmc-etf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c index e68289b8c072..5fa49c4252f6 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etf.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c @@ -168,7 +168,7 @@ out: spin_unlock_irqrestore(&drvdata->spinlock, flags); /* Free memory outside the spinlock if need be */ - if (!used && buf) + if (!used) kfree(buf); if (!ret)