Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp3898672ybn; Fri, 27 Sep 2019 13:01:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqx75HLLb+MAQoN4WRDccLKKlTgfaEZo3I0DUDH1zoUbh+K93xoCuXqF+LWgB8+AkFcSPMiY X-Received: by 2002:a17:906:3294:: with SMTP id 20mr9314714ejw.19.1569614509661; Fri, 27 Sep 2019 13:01:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569614509; cv=none; d=google.com; s=arc-20160816; b=qF6rO/5JA78g6oYxOCPLGNLe6dXiSaJGL2yBviEoQnUimaN36laHA6eqJyy6dvUAxA qMFeWZbjm7YREZGvgi0w5vOvWW3EJkW0/lssye16ylzBrzTHJ1M1YLYBOoYkI2PHCLRD tXWLVXbCU7HUxq38STxurv+uOxDtDWoT9gh8KnaGfa1EFhL+Ziu82gwXRCFcusI/J+9c 8yl901bxtjXqZ8xUAT9hgRcJP2bkPH1iL9FXQsVAL7FWo8/5nlc42E+N8iQKTcX+vIBU caM0SE61IiLa3ieM3RL5nYn+J0N5zb4hPToR9Nur1LpwTYjGlBxsI5mv3bhoMjhqFTBd RhRw== 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=m3N4g1+PrfrGvTWq17kt8QawJwiN+yoHqzlqWwVCtqw=; b=eVlcqJKdznVdyCJ6ThSUYAJMOGsszMFa2g9PanTq+IaJnapFzrDTD4mmzt0xzGHmlt zgo2bkeV9VVpR4lhea0x1ixmDrJ3CcgnjkVFuci7fGsUozrUpFB6AAOWC7cgtzp8iFHF +Y3We4qZCvGV9HB2+2U7Ba/9Fb3Lcb9shRRVCr8sSaQr5Pfadaydz+LbK3ViPl7SgnZG 5u5o78ty8mgDrOONS6+wUxXWb9VFBdEXsbEGkJnAjGseKazxVxD9lCjLVyRirLHDNUZz q1XfSGfpSlZSpOBapIvSB7UIjqMqGZREYvbQ9n6hRiE5nHzGWaDQO5N0lOsfwcRhoNMb TW4w== 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 g11si3315349ejc.366.2019.09.27.13.01.24; Fri, 27 Sep 2019 13:01:49 -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 S1727607AbfI0UBN (ORCPT + 99 others); Fri, 27 Sep 2019 16:01:13 -0400 Received: from proxima.lasnet.de ([78.47.171.185]:51977 "EHLO proxima.lasnet.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725802AbfI0UBN (ORCPT ); Fri, 27 Sep 2019 16:01:13 -0400 Received: from localhost.localdomain (p200300E9D742D296A393C26E681B47E6.dip0.t-ipconnect.de [IPv6:2003:e9:d742:d296:a393:c26e:681b:47e6]) (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 890E7C1B22; Fri, 27 Sep 2019 22:01:10 +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: Date: Fri, 27 Sep 2019 22:01:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <20190917224713.26371-1-navid.emamdoost@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed 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. 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) { > As Harry seems to be unavailable I am taking this patch directly. This patch has been applied to the wpan tree and will be part of the next pull request to net. Thanks! regards Stefan Schmidt