Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2089674ybz; Sun, 26 Apr 2020 10:55:46 -0700 (PDT) X-Google-Smtp-Source: APiQypKLYFIYHRoMjvB90HIuM2iSt0uRu218zY6jYRK/2Zjq+xMXaDwB+XBAxSvdjgnl2zmaCNvG X-Received: by 2002:a05:6402:2076:: with SMTP id bd22mr16022368edb.334.1587923739546; Sun, 26 Apr 2020 10:55:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587923739; cv=none; d=google.com; s=arc-20160816; b=FXThlpRsdv2muztEcouqwSdU9ju7SdPVOJBMy+PEd7oxE0L5iCwPOfE7HUzzgrP8P7 nfKIQI66JyEPoO9oa7aM1oNq6PifD+Y4l4c1mNm/YgArt0qNHxERsIGsANxoCeC6J+9o CU03LDXAoNY2xOODqQWQZ8KfpnQeS/AU8WV2C9c+HDcsC0n6BUG9sB8U67wi7WL0dqxR mAG5Xo2RXhORoGoKIHekKXYawsEbx39KVx/m1lrdjboL4eqNG3g6/B2jp/ylduK+QXU8 t+u8tJfXWCRDbnEd+/9AbNLdt5HCOZFuirBcjp1Dcloy9X0Qoy4xMhjjOY9GBLSb/B1n vtPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=30JOaEpf+QiadQTh+dgHJ2slB0a4B9bmp/2okp3fm2w=; b=pMlIP9yB0iXsDmBSsJC8mOEsx/fDJ6i9nFVkVpqyrD2HVtjjePJNvAQ6CObhynz6+V OUqeqIgtA0lzzVbHTysXHbNMCYcFt2JHE8MCpQUqKqz0k/VHUVuAqLkYNqshQCeUVI23 0Y6qQA+fqpRmJDbCmTRBg0lD9TJOJOhG3cDmDj80kfUKnE84OWaR6dp/JbZiYKx9Ul4u vfVpiln5mhktftZNFY3MissVCugg3l52+/eCpr2R0B53cWmA8PjujgVDQVlh4ksxMStB dV++dvHas0aBi1CPGIPxmkj1WRwZ7C0x/jjX/q2QH6aQVOX8YaW+1WVxzxn36K07oscr jaJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb5si6995393edb.57.2020.04.26.10.55.16; Sun, 26 Apr 2020 10:55:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726156AbgDZRxK (ORCPT + 99 others); Sun, 26 Apr 2020 13:53:10 -0400 Received: from smtprelay0124.hostedemail.com ([216.40.44.124]:40336 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726151AbgDZRxK (ORCPT ); Sun, 26 Apr 2020 13:53:10 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id 69AA75DE1; Sun, 26 Apr 2020 17:53:09 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:800:960:966:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2553:2559:2562:2693:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3871:3872:3874:4321:4385:5007:6119:7903:9389:10004:10400:10450:10455:10848:11026:11232:11473:11657:11658:11914:12043:12048:12296:12297:12438:12663:12740:12895:13069:13311:13357:13439:13894:14181:14659:14721:19904:19999:21080:21433:21451:21627:21990:30054:30064:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: eye08_558d5011d7757 X-Filterd-Recvd-Size: 2129 Received: from XPS-9350.home (unknown [47.151.136.130]) (Authenticated sender: joe@perches.com) by omf07.hostedemail.com (Postfix) with ESMTPA; Sun, 26 Apr 2020 17:53:07 +0000 (UTC) Message-ID: Subject: Re: [PATCH] drm/radeon: cleanup coding style a bit From: Joe Perches To: Christian =?ISO-8859-1?Q?K=F6nig?= , Bernard Zhao , Alex Deucher , "David (ChunMing) Zhou" , David Airlie , Daniel Vetter , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com Date: Sun, 26 Apr 2020 10:53:06 -0700 In-Reply-To: <2c67e29b-df17-6ae3-cb55-af950acc022c@amd.com> References: <20200426131244.22293-1-bernard@vivo.com> <2c67e29b-df17-6ae3-cb55-af950acc022c@amd.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2020-04-26 at 15:18 +0200, Christian K?nig wrote: > Am 26.04.20 um 15:12 schrieb Bernard Zhao: > > Maybe no need to check ws before kmalloc, kmalloc will check > > itself, kmalloc`s logic is if ptr is NULL, kmalloc will just > > return > > > > Signed-off-by: Bernard Zhao > > Reviewed-by: Christian K?nig > > I'm wondering why the automated scripts haven't found that one before. because this pattern is if (foo) kfree(bar); and the pattern looked for is: if (foo) kfree(foo); > > diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c [] > > @@ -1211,8 +1211,7 @@ static int atom_execute_table_locked(struct atom_context *ctx, int index, uint32 > > SDEBUG("<<\n"); > > > > free: > > - if (ws) > > - kfree(ectx.ws); > > + kfree(ectx.ws); > > return ret; > > } I'm wondering if this removal is correct as the function is named _locked and it may be recursive or called under some external lock.