From patchwork Fri Mar 27 08:11:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 11464799 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 735E1913 for ; Mon, 30 Mar 2020 07:13:07 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5C2ED2073B for ; Mon, 30 Mar 2020 07:13:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C2ED2073B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=inria.fr Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5DDBD6E061; Mon, 30 Mar 2020 07:11:54 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 430 seconds by postgrey-1.36 at gabe; Fri, 27 Mar 2020 08:18:58 UTC Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by gabe.freedesktop.org (Postfix) with ESMTPS id 062A16E3F5 for ; Fri, 27 Mar 2020 08:18:57 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.72,311,1580770800"; d="scan'208";a="343986645" Received: from abo-173-121-68.mrs.modulonet.fr (HELO hadrien) ([85.68.121.173]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2020 09:11:44 +0100 Date: Fri, 27 Mar 2020 09:11:44 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Daniel Vetter Subject: [PATCH] drm: fix ifnullfree.cocci warnings Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 30 Mar 2020 07:11:44 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kbuild-all@lists.01.org, David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Thomas Zimmermann , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" NULL check before kfree is not needed. Generated by: scripts/coccinelle/free/ifnullfree.cocci Fixes: c6603c740e0e ("drm: add managed resources tied to drm_device") Signed-off-by: kbuild test robot Signed-off-by: Julia Lawall --- tree: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next head: 9e1ed9fb1eb0a4bc43a26365c592d3095286038b commit: c6603c740e0e3492c9c95fdab833375bf7117b6b [1587/1636] drm: add managed resources tied to drm_device :::::: branch date: 8 hours ago :::::: commit date: 9 hours ago Up to you, if you tihnk it is useful... drm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -837,8 +837,9 @@ static void drm_dev_release(struct kref if (!dev->driver->release && !dev->managed.final_kfree) { WARN_ON(!list_empty(&dev->managed.resources)); kfree(dev); - } else if (dev->managed.final_kfree) + } else { kfree(dev->managed.final_kfree); + } } /**