stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Andy Gross <andy.gross@linaro.org>
Cc: David Brown <david.brown@linaro.org>,
	linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org, Johan Hovold <johan@kernel.org>,
	stable <stable@vger.kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>
Subject: Re: [PATCH] soc: qcom: rmtfs-mem: fix memleak in probe error paths
Date: Fri, 6 Jul 2018 14:06:58 +0200	[thread overview]
Message-ID: <20180706120658.GF9802@localhost> (raw)
In-Reply-To: <20180612124141.6307-1-johan@kernel.org>

On Tue, Jun 12, 2018 at 02:41:41PM +0200, Johan Hovold wrote:
> Make sure to set the mem device release callback before calling
> put_device() in a couple of probe error paths so that the containing
> object also gets freed.
> 
> Fixes: d1de6d6c639b ("soc: qcom: Remote filesystem memory driver")
> Cc: stable <stable@vger.kernel.org>     # 4.15
> Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
> Signed-off-by: Johan Hovold <johan@kernel.org>

I noticed that this one hasn't made it into linux-next yet, so sending a
reminder.

> ---
>  drivers/soc/qcom/rmtfs_mem.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/soc/qcom/rmtfs_mem.c b/drivers/soc/qcom/rmtfs_mem.c
> index c8999e38b005..8a3678c2e83c 100644
> --- a/drivers/soc/qcom/rmtfs_mem.c
> +++ b/drivers/soc/qcom/rmtfs_mem.c
> @@ -184,6 +184,7 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
>  	device_initialize(&rmtfs_mem->dev);
>  	rmtfs_mem->dev.parent = &pdev->dev;
>  	rmtfs_mem->dev.groups = qcom_rmtfs_mem_groups;
> +	rmtfs_mem->dev.release = qcom_rmtfs_mem_release_device;
>  
>  	rmtfs_mem->base = devm_memremap(&rmtfs_mem->dev, rmtfs_mem->addr,
>  					rmtfs_mem->size, MEMREMAP_WC);
> @@ -206,8 +207,6 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
>  		goto put_device;
>  	}
>  
> -	rmtfs_mem->dev.release = qcom_rmtfs_mem_release_device;
> -
>  	ret = of_property_read_u32(node, "qcom,vmid", &vmid);
>  	if (ret < 0 && ret != -EINVAL) {
>  		dev_err(&pdev->dev, "failed to parse qcom,vmid\n");

Thanks,
Johan

      reply	other threads:[~2018-07-06 12:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-12 12:41 [PATCH] soc: qcom: rmtfs-mem: fix memleak in probe error paths Johan Hovold
2018-07-06 12:06 ` Johan Hovold [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180706120658.GF9802@localhost \
    --to=johan@kernel.org \
    --cc=andy.gross@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).