Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751919AbbFZGyG (ORCPT ); Fri, 26 Jun 2015 02:54:06 -0400 Received: from darkcity.gna.ch ([195.226.6.51]:51361 "EHLO mail.gna.ch" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750993AbbFZGx7 (ORCPT ); Fri, 26 Jun 2015 02:53:59 -0400 X-Greylist: delayed 438 seconds by postgrey-1.27 at vger.kernel.org; Fri, 26 Jun 2015 02:53:59 EDT Subject: Re: [PATCH 1/1] gpu/drm: remove unnecessary check before kfree To: Maninder Singh References: <1435299946-4610-1-git-send-email-maninder1.s@samsung.com> Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, pankaj.m@samsung.com From: =?UTF-8?Q?Michel_D=c3=a4nzer?= X-Enigmail-Draft-Status: N1110 Message-ID: <558CF549.7030909@daenzer.net> Date: Fri, 26 Jun 2015 15:46:33 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.0 MIME-Version: 1.0 In-Reply-To: <1435299946-4610-1-git-send-email-maninder1.s@samsung.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1505 Lines: 39 On 26.06.2015 15:25, Maninder Singh wrote: > 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 */ > The shortlog prefix of both your patches should be "drm/amdgpu:" instead of "gpu/drm:". With that fixed, both are Reviewed-by: Michel Dänzer -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer -- 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/