From patchwork Wed Apr 13 07:07:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fengguang Wu X-Patchwork-Id: 8818571 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 78330C0553 for ; Wed, 13 Apr 2016 07:09:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AB3FC2025A for ; Wed, 13 Apr 2016 07:09:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DF60A2024F for ; Wed, 13 Apr 2016 07:09:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 65CF76E85A; Wed, 13 Apr 2016 07:09:20 +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 ESMTP id C89C26E36C for ; Wed, 13 Apr 2016 07:09:18 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 13 Apr 2016 00:09:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,478,1455004800"; d="scan'208";a="957558747" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga002.fm.intel.com with ESMTP; 13 Apr 2016 00:09:17 -0700 Received: from kbuild by bee with local (Exim 4.83) (envelope-from ) id 1aqEvI-000EAq-50; Wed, 13 Apr 2016 15:09:12 +0800 Date: Wed, 13 Apr 2016 15:07:42 +0800 From: kbuild test robot To: Karol Herbst Subject: [PATCH] drm/nouveau/iccsense: fix ifnullfree.cocci warnings Message-ID: <20160413070742.GA9311@lkp-nex05> References: <201604131531.CJokPLHc%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201604131531.CJokPLHc%fengguang.wu@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Ben Skeggs , kbuild-all@01.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c:133:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values. 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 CC: Karol Herbst Signed-off-by: Fengguang Wu Signed-off-by: Martin Peres Signed-off-by: Karol Herbst --- base.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c @@ -129,8 +129,7 @@ nvkm_iccsense_dtor(struct nvkm_subdev *s { struct nvkm_iccsense *iccsense = nvkm_iccsense(subdev); - if (iccsense->rails) - kfree(iccsense->rails); + kfree(iccsense->rails); return iccsense; }