From patchwork Mon Feb 25 18:39:27 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: 10828997 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 A56E51390 for ; Mon, 25 Feb 2019 18:40:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 966F12AE0D for ; Mon, 25 Feb 2019 18:40:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 872052AE0F; Mon, 25 Feb 2019 18:40:05 +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 43A642AE0D for ; Mon, 25 Feb 2019 18:40:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CAD6F89B3B; Mon, 25 Feb 2019 18:39:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id A042389B22; Mon, 25 Feb 2019 18:39:56 +0000 (UTC) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Feb 2019 10:39:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,412,1544515200"; d="scan'208";a="129232742" Received: from lkp-server01.sh.intel.com (HELO lkp-server01) ([10.239.97.150]) by orsmga003.jf.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-000CJJ-Mw; Tue, 26 Feb 2019 02:39:52 +0800 Date: Tue, 26 Feb 2019 02:39:27 +0800 From: kbuild test robot To: Qiang Yu Subject: [PATCH] drm/lima: fix ifnullfree.cocci warnings Message-ID: <20190225183927.GA32253@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_object.c:14:3-8: WARNING: NULL check before some freeing functions is not needed. drivers/gpu/drm/lima/lima_object.c:35: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_object.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/drivers/gpu/drm/lima/lima_object.c +++ b/drivers/gpu/drm/lima/lima_object.c @@ -10,8 +10,7 @@ void lima_bo_destroy(struct lima_bo *bo) { if (bo->sgt) { - if (bo->pages) - kfree(bo->pages); + kfree(bo->pages); drm_prime_gem_destroy(&bo->gem, bo->sgt); } @@ -31,8 +30,7 @@ void lima_bo_destroy(struct lima_bo *bo) drm_gem_put_pages(&bo->gem, bo->pages, true, true); } - if (bo->pages_dma_addr) - kfree(bo->pages_dma_addr); + kfree(bo->pages_dma_addr); drm_gem_object_release(&bo->gem); kfree(bo);