From: Ben Skeggs <skeggsb@gmail.com>
To: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/nouveau/iccsense: fix memory leak on default sensor->type case
Date: Fri, 3 Jun 2016 08:28:27 +1000 [thread overview]
Message-ID: <0d714853-4c6e-6fb2-0aa9-bac99642bd38@gmail.com> (raw)
In-Reply-To: <1464863332-9610-1-git-send-email-colin.king@canonical.com>
[-- Attachment #1.1.1: Type: text/plain, Size: 1166 bytes --]
On 06/02/2016 08:28 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The default sensor->type case leaks memory allocated to rail. Fix
> this by free'ing rail before we continue with the next loop iteration.
This doesn't completely fix the issue, as there are continue statements
in other sections of the code that can leak also.
That said, I already have a patch fixing this issue in a branch I
haven't pushed as of yet, I'll split it out later today.
Thanks,
Ben.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c
> index 323c79a..79b0eb5 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c
> @@ -305,6 +305,7 @@ nvkm_iccsense_oneinit(struct nvkm_subdev *subdev)
> rail->read = nvkm_iccsense_ina3221_read;
> break;
> default:
> + kfree(rail);
> continue;
> }
>
>
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-06-02 22:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-02 10:28 [PATCH] drm/nouveau/iccsense: fix memory leak on default sensor->type case Colin King
2016-06-02 22:28 ` Ben Skeggs [this message]
[not found] ` <1464863332-9610-1-git-send-email-colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2016-06-03 9:55 ` karol herbst
2016-06-03 10:42 ` [Nouveau] " Colin Ian King
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=0d714853-4c6e-6fb2-0aa9-bac99642bd38@gmail.com \
--to=skeggsb@gmail.com \
--cc=dri-devel@lists.freedesktop.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