From patchwork Mon Feb 25 18:39:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot X-Patchwork-Id: 10828999 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BA9C8139A for ; Mon, 25 Feb 2019 18:40:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8F922AE0D for ; Mon, 25 Feb 2019 18:40:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9AE7B2AE10; Mon, 25 Feb 2019 18:40:07 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2E8152AE0D for ; Mon, 25 Feb 2019 18:40:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DE03689B38; Mon, 25 Feb 2019 18:40:01 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 593E889B22; Mon, 25 Feb 2019 18:39:56 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Feb 2019 10:39:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,412,1544515200"; d="scan'208";a="149855185" Received: from lkp-server01.sh.intel.com (HELO lkp-server01) ([10.239.97.150]) by fmsmga001.fm.intel.com with ESMTP; 25 Feb 2019 10:39:53 -0800 Received: from kbuild by lkp-server01 with local (Exim 4.89) (envelope-from ) id 1gyLAO-000CIo-Km; Tue, 26 Feb 2019 02:39:52 +0800 Date: Tue, 26 Feb 2019 02:39:28 +0800 From: kbuild test robot To: Qiang Yu Subject: [PATCH] drm/lima: fix ifnullfree.cocci warnings Message-ID: <20190225183927.GA32733@lkp-wsm-ep1> References: <20190225140717.20586-3-yuq825@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190225140717.20586-3-yuq825@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Simon Shields , lima@lists.freedesktop.org, Neil Armstrong , Maxime Ripard , Christian =?iso-8859-1?q?K=F6nig?= , dri-devel@lists.freedesktop.org, Vasily Khoruzhick , David Airlie , kbuild-all@01.org, Erico Nunes , Sean Paul , Andreas Baierl , Qiang Yu Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: kbuild test robot drivers/gpu/drm/lima/lima_sched.c:35:2-20: WARNING: NULL check before some freeing functions is not needed. drivers/gpu/drm/lima/lima_sched.c:146:2-7: WARNING: NULL check before some freeing functions is not needed. NULL check before some freeing functions is not needed. Based on checkpatch warning "kfree(NULL) is safe this check is probably not required" and kfreeaddr.cocci by Julia Lawall. Generated by: scripts/coccinelle/free/ifnullfree.cocci Fixes: ef1d65006858 ("drm/lima: driver for ARM Mali4xx GPUs") CC: Qiang Yu Signed-off-by: kbuild test robot --- url: https://github.com/0day-ci/linux/commits/Qiang-Yu/drm-export-drm_timeout_abs_to_jiffies/20190226-010350 Please take the patch only if it's a positive warning. Thanks! lima_sched.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/drivers/gpu/drm/lima/lima_sched.c +++ b/drivers/gpu/drm/lima/lima_sched.c @@ -31,8 +31,7 @@ int lima_sched_slab_init(void) void lima_sched_slab_fini(void) { - if (lima_fence_slab) - kmem_cache_destroy(lima_fence_slab); + kmem_cache_destroy(lima_fence_slab); } static inline struct lima_fence *to_lima_fence(struct dma_fence *fence) @@ -142,8 +141,7 @@ void lima_sched_task_fini(struct lima_sc dma_fence_put(task->dep[i]); } - if (task->dep) - kfree(task->dep); + kfree(task->dep); if (task->bos) { for (i = 0; i < task->num_bos; i++)