Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp40627ybj; Thu, 19 Sep 2019 10:20:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCGQj52n67TM3LedwZva/QwN/9MEp+ctDrbxH5AXtilzilcasf+WdBm/Ld6ujpHn2siFsl X-Received: by 2002:a50:fd10:: with SMTP id i16mr14807500eds.239.1568913605721; Thu, 19 Sep 2019 10:20:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568913605; cv=none; d=google.com; s=arc-20160816; b=fnDy3L/J/sHcX8+TxBk08bznGJXTQVUWr2uME5sSvRYY2SPqMGRzCWrnQDjF4Rx4bl 0LX0nArhHPFRqH5ZEOsbZYhY6yGqMWepnpy314pDFucXHmaKJm5y7PMsoaDoY8wYUIqS ei+VQsGUafGHib5PzxbzMUoZBjh8Bd/QX/Lt08qQQD+EkI7IlvHCLglJG8l1jQ2OmiT/ /tCQLHIk/lpSzuZlCcbvl58bC20leluHydoHI7a6Xuy/4xOB3HhN8vsk/T68cV0ANJJt jpNgYc58NgpeRI79rTHk9+ma5yy5Nqx7s+BP0G+jX3I3v9qdGZaGDZEM9dx7sQ0bbmqJ 1//A== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Y88wY/rruTZKZmHIcdau9IEZvKKmJXiaYr6VamapktE=; b=nak48+Zx/Bvj5gH3jkRuEzy3XCyaQoRM+MQhZ3z2It3rsJ7xmZgfSaPrmaBr0iePdv SWxcN53nvurBlVMkOLzf0M/pE9gvvjrP2/gbBLhmrYA8O528AD8TQvDtoqyntpEdNGzx LawMuEU8XjelnMtFgKVWT95n3FkQijs/MERrB0J3U/CXHfBPGmponyhpOl4zcDsj8zqy rlh/h1eG0CEmII79ZIesA2T7x6V1fzgzljzGpqHv6jEXKfLxZGW3q4BKRA5CXJvlTyH9 lRcVVIcC3UpEnHm4P844XbVVhXRW6ajps2mx3dmU0lMQ0/9uNC+dGCQkJyDiYePXc8ww tDtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s18si4943823ejb.49.2019.09.19.10.19.42; Thu, 19 Sep 2019 10:20:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390808AbfISO4q (ORCPT + 99 others); Thu, 19 Sep 2019 10:56:46 -0400 Received: from proxima.lasnet.de ([78.47.171.185]:50660 "EHLO proxima.lasnet.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728720AbfISO4q (ORCPT ); Thu, 19 Sep 2019 10:56:46 -0400 Received: from localhost.localdomain (p200300E9D7197E1C5D26FA1D92192C91.dip0.t-ipconnect.de [IPv6:2003:e9:d719:7e1c:5d26:fa1d:9219:2c91]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: stefan@datenfreihafen.org) by proxima.lasnet.de (Postfix) with ESMTPSA id 00C25C11CD; Thu, 19 Sep 2019 16:56:43 +0200 (CEST) Subject: Re: [PATCH] ieee802154: ca8210: prevent memory leak To: Navid Emamdoost Cc: emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu, Harry Morris , Alexander Aring , "David S. Miller" , linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190917224713.26371-1-navid.emamdoost@gmail.com> From: Stefan Schmidt Message-ID: <5c53dd25-80de-86ce-5072-bdb6a54835bd@datenfreihafen.org> Date: Thu, 19 Sep 2019 16:56:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190917224713.26371-1-navid.emamdoost@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Harry. On 18.09.19 00:47, Navid Emamdoost wrote: > In ca8210_probe the allocated pdata needs to be assigned to > spi_device->dev.platform_data before calling ca8210_get_platform_data. > Othrwise when ca8210_get_platform_data fails pdata cannot be released. > > Signed-off-by: Navid Emamdoost > --- > drivers/net/ieee802154/ca8210.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c > index b188fce3f641..229d70a897ca 100644 > --- a/drivers/net/ieee802154/ca8210.c > +++ b/drivers/net/ieee802154/ca8210.c > @@ -3152,12 +3152,12 @@ static int ca8210_probe(struct spi_device *spi_device) > goto error; > } > > + priv->spi->dev.platform_data = pdata; > ret = ca8210_get_platform_data(priv->spi, pdata); > if (ret) { > dev_crit(&spi_device->dev, "ca8210_get_platform_data failed\n"); > goto error; > } > - priv->spi->dev.platform_data = pdata; > > ret = ca8210_dev_com_init(priv); > if (ret) { > Could you review this patch for the ca8210 driver? regards Stefan Schmidt