Message ID | Y6s9tOVk5A8NFmyH@qemulion |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1531210wrt; Tue, 27 Dec 2022 10:49:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXuI/5t8lc3LALGw52701u0oHC55aNNFWp6BLGwvpIS6jM24onXb1Up+OwT/TFQ/cCQ5E2Yu X-Received: by 2002:a17:902:a58a:b0:192:8da5:eab2 with SMTP id az10-20020a170902a58a00b001928da5eab2mr3473280plb.54.1672166971172; Tue, 27 Dec 2022 10:49:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672166971; cv=none; d=google.com; s=arc-20160816; b=PGEzyscAUnGpEWyvI2jDWObBpqGytYSmbGa8YPUNjOm7zdin2LRYoTxIVlTz+5KT5W lGZZCn/DtHKWDXnlyq0YoVmkwkDtklLTqEsWdr5+Y+//+tDSzUb6UIxjxTKjUeK2kB6O XW2OjpEMhy6z6mNGf9vQOIvpdKIsyrl63ch/NZ4jeHrAcosmgxv3v5cTkXG139IusYky xp0OAxMH3IaQUCR2Fzqaj51IKrZ/AUDrX5OGvEDmIos0S4KI4v9VtZkI0genxtEQWN32 LF6JLt0jXgD5D2v/BPVbleNv8Dd1pv9SDoN9S+IkmyLP7vqh+Hh9Ss6fg56IomhjFOzj gVqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=s+lWYhZcrCjtVh2KKJ+gMD3BMOaKNVGxpvnrQARtUW8=; b=Svsoj66ObD3VaFTciLxrwu1F2n69rcwGOFWjb4+X3ucRXu8bygz7PfpqEM4Q10NZyR SUGr0gx9rY+ipCfGhgE2XfSffGXW3X/qOXrsYyXWwMpWbo2Qc54Q0TY6xVAOjPCOsBfP xsW21Ejut2pgI+J9420HzFts4HfCVM9rj2zzzGGJaQwOMd1hi5VCNJN5YwYB3VTK0LLi TR7d2huueNiIaAnT+be7gDcP/szPI/eVgaEYwtlohXij4WiJfgUlOwD0MWhr1z+i0lFa 2O0Zobo3hKpDpaVtALlLM2jAPgAhTP2pke9klLm/xSHEQ5+VD9KAA7Egd34l2ji32coI TPvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b="EOtp/gR6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n16-20020a170902e55000b001898d8881d1si16335600plf.598.2022.12.27.10.49.18; Tue, 27 Dec 2022 10:49:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b="EOtp/gR6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230285AbiL0Sr3 (ORCPT <rfc822;eddaouddi.ayoub@gmail.com> + 99 others); Tue, 27 Dec 2022 13:47:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229533AbiL0Sr1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 27 Dec 2022 13:47:27 -0500 Received: from msg-2.mailo.com (msg-2.mailo.com [213.182.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87D38C75B; Tue, 27 Dec 2022 10:47:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1672166840; bh=2S5RKj0QcrEEWtKwPpcpUFIPdyQBeGymwnI0h0TfvRs=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=EOtp/gR6nr6ZW/pSEkYSxekMI8r5UnfYcoO2Pf2xk/LBvOWDb1wH49l4YGMByWn5L AnvfirxsAA73fuPF9E5CAvEYL0DFPaVuDtHnauBqMJOy10BwGTum8Sqao91s97vqkg d5c+qYhj/d08u58hOv5ihIdQ9lOP+pcoevt/ZNlM= Received: by b-4.in.mailobj.net [192.168.90.14] with ESMTP via ip-206.mailobj.net [213.182.55.206] Tue, 27 Dec 2022 19:47:20 +0100 (CET) X-EA-Auth: eh4aWBOqXM8zlyBx5vUHM3kW6Z6FtHguRCMzJAdXbIklLRAt3EolwzZIKCDoMaD+B/ThxNFpJgI8lL6S2B4v0iKyaCm/776g Date: Wed, 28 Dec 2022 00:17:16 +0530 From: Deepak R Varma <drv@mailo.com> To: Thierry Reding <thierry.reding@gmail.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar <ssengar@microsoft.com>, Praveen Kumar <kumarpraveen@linux.microsoft.com>, Deepak R Varma <drv@mailo.com> Subject: [PATCH] gpu: host1x: No need for Null pointer check before kfree Message-ID: <Y6s9tOVk5A8NFmyH@qemulion> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753394153785746411?= X-GMAIL-MSGID: =?utf-8?q?1753394153785746411?= |
Series |
gpu: host1x: No need for Null pointer check before kfree
|
|
Commit Message
Deepak R Varma
Dec. 27, 2022, 6:47 p.m. UTC
kfree() & vfree() internally performs NULL check on the pointer handed
to it and take no action if it indeed is NULL. Hence there is no need
for a pre-check of the memory pointer before handing it to
kfree()/vfree().
Issue reported by ifnullfree.cocci Coccinelle semantic patch script.
Signed-off-by: Deepak R Varma <drv@mailo.com>
---
drivers/gpu/host1x/fence.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--
2.34.1
diff --git a/drivers/gpu/host1x/fence.c b/drivers/gpu/host1x/fence.c index df428bcbae69..42498902947f 100644 --- a/drivers/gpu/host1x/fence.c +++ b/drivers/gpu/host1x/fence.c @@ -93,8 +93,7 @@ static void host1x_syncpt_fence_release(struct dma_fence *f) { struct host1x_syncpt_fence *sf = to_host1x_fence(f); - if (sf->waiter) - kfree(sf->waiter); + kfree(sf->waiter); dma_fence_free(f); }