Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751847AbbFZG1s (ORCPT ); Fri, 26 Jun 2015 02:27:48 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:39928 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750729AbbFZG1l (ORCPT ); Fri, 26 Jun 2015 02:27:41 -0400 X-AuditID: cbfee68d-f79106d00000728c-a9-558cf0d3f6b3 From: Maninder Singh To: airlied@linux.ie, alexander.deucher@amd.com, christian.koenig@amd.com, Jammy.Zhou@amd.com, young.yang@amd.com, samuel.li@amd.com, marek.olsak@amd.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: pankaj.m@samsung.com, Maninder Singh Subject: [PATCH 1/1] gpu/drm: remove unnecessary check before kfree Date: Fri, 26 Jun 2015 11:55:46 +0530 Message-id: <1435299946-4610-1-git-send-email-maninder1.s@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOLMWRmVeSWpSXmKPExsWyRsSkSvfyh55Qg1uTBC16z51ksph2Zzer xdv7QOLK1/dsFjM/7WSzuLxrDpvF4fltLBZTX/9lt7j3ZiuTxeHe94wWa37PYHbg9mi99JfN Y/u3B6we97uPM3n0bVnF6PF5k1wAaxSXTUpqTmZZapG+XQJXRmPXP+aCb2wVR3dsZGtg/Mva xcjJISFgInF58SNmCFtM4sK99WxdjFwcQgJLGSU23DzBDFP0/8YbRojEIkaJlRt3QDk/GSV+ z94KVsUmoCexatceFpCEiMA9RomzXyYD7eDgYBZwkpj+VQ+kRljAWWL1m5lg9SwCqhJP3h5m ArF5Bdwk/rTtYQcplxBQkJgzyQZkjITAPHaJjU/3sUDUC0h8m3yIBaJGVmLTAajjJCUOrrjB MoFRcAEjwypG0dSC5ILipPQiQ73ixNzi0rx0veT83E2MwPA+/e9Z7w7G2wesDzEKcDAq8fAK vO8JFWJNLCuuzD3EaAq0YSK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84M9ol2 TVl7DWSFjb0P8xzoDtbc8ni9rsqrXKHbUwvL67/zX/0RW3y6RomlOCPRUIu5qDgRAClywwu0 AgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1106 Lines: 30 kfree(NULL) is safe and this check is probably not required Signed-off-by: Maninder Singh Reviewed-by: Vaneet Narang --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index fec487d..a85cd08 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -1575,8 +1575,7 @@ void amdgpu_device_fini(struct amdgpu_device *adev) amdgpu_fence_driver_fini(adev); amdgpu_fbdev_fini(adev); r = amdgpu_fini(adev); - if (adev->ip_block_enabled) - kfree(adev->ip_block_enabled); + kfree(adev->ip_block_enabled); adev->ip_block_enabled = NULL; adev->accel_working = false; /* free i2c buses */ -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/