Path: csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod From: Neil Armstrong Newsgroups: linux.kernel Subject: Re: [PATCH v2 1/5] net: dsa: add missing kfree on remove Date: Tue, 06 Oct 2015 09:30:02 +0200 Message-ID: References: X-Original-To: Sergei Shtylyov , "David S. Miller" , Florian Fainelli , Guenter Roeck , vivien.didelot@savoirfairelinux.com, Andrew Lunn , Fabian Frederick , Pavel Nakonechny , Joe Perches , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, nbd@openwrt.org X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=+Jf6fGc7cIPSGu4PrM9W7x/1XJKVaBL8KnKJv7EmcqA=; b=YWbS44KlYiDAKBYMx0mZx9yAM9ns8GTf+u33e1SjnJhUDWxPFeM0OL82V1piAJF+qS F3+qlTqW97W2eBmvVXnfXPmsyDKG8+nqDe2JM/+9lELwOzvbaIown+w5MSbjNAaMFyIZ XgMJBU3GOxUpA6P+NQHVQweK6NVrhC6IlsDd+aRFSAHLOVWWIUiAiDW0dBsRnfdA56kV x1xA3+6Q4+r8+EVQMoyqYnCI5D/Ead14qEIMrjY+KGabthHbAdeqS6dMf0qnrZlGoa9B dccc6492mFBYoPVtIhYwN1zwwbK9ggALfs2CWU5PMMPElwKTPO0Grs2RnWiUfT2iE+o4 xQ8A== X-Gm-Message-State: ALoCoQn7m5nC5JUFSsvRp30W0Mef8wR3Hx94Z6kzi4ag8KyL+DO+XfnSfda0WDM0GW17G20KtGZk X-Received: by 10.194.112.162 with SMTP id ir2mr39318513wjb.40.1444116333635; Tue, 06 Oct 2015 00:25:33 -0700 (PDT) Organization: Baylibre User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 48 X-Original-Date: Tue, 6 Oct 2015 08:25:33 +0100 X-Original-Message-ID: <5613776D.8060103@baylibre.com> X-Original-References: <560FE575.7000003@baylibre.com> <560FE731.6050600@cogentembedded.com> <560FF239.2060903@baylibre.com> <56104E99.5020105@cogentembedded.com> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1240200 On 10/03/2015 10:54 PM, Sergei Shtylyov wrote: > On 10/3/2015 6:20 PM, Neil Armstrong wrote: > >>> On 10/3/2015 5:25 PM, Neil Armstrong wrote: >>> >>>> To prevent memory leakage on unbinding, add missing kfree calls. >>>> >>>> Signed-off-by: Neil Armstrong >>>> --- >>>> net/dsa/dsa.c | 5 ++++- >>>> 1 file changed, 4 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c >>>> index c59fa5d..12cec40 100644 >>>> --- a/net/dsa/dsa.c >>>> +++ b/net/dsa/dsa.c >>>> @@ -914,8 +914,10 @@ static void dsa_remove_dst(struct dsa_switch_tree *dst) >>>> for (i = 0; i < dst->pd->nr_chips; i++) { >>>> struct dsa_switch *ds = dst->ds[i]; >>>> >>>> - if (ds != NULL) >>>> + if (ds != NULL) { >>> >>> Didn;t scripts/checkpatch.pl complain here? just if (ds) is preferred in the networking code. >>> >>> MBR, Sergei >>> >> Yes, >> >> But I considered the cosmetic changes are not the subject of this serie. > > Formally, all the patches should be checkpatch-clean... > >> Neil > > MBR, Sergei > Sure, How should I handle this case ? A separate patch with the cosmetic change before the kfree addition ? Neil -- 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/