Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1360877
| From | Alex Deucher <alexdeucher@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] drm/amd/powerplay: fix memory leak of tdp_table |
| Date | 2016-03-18 20:20 +0100 |
| Message-ID | <re86e-5Tk-11@gated-at.bofh.it> (permalink) |
| References | <re5L4-23u-25@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Mar 18, 2016 at 12:47 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> tdp_table is being leaked on failed allocations of
> hwmgr->dyn_state.cac_dtp_table. kfree tdp_table on the error
> return path to fix the leak.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied, thanks!
Alex
> ---
> drivers/gpu/drm/amd/powerplay/hwmgr/tonga_processpptables.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_processpptables.c
> index 34f4bef..b156481 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_processpptables.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_processpptables.c
> @@ -512,8 +512,10 @@ static int get_cac_tdp_table(
>
> hwmgr->dyn_state.cac_dtp_table = kzalloc(table_size, GFP_KERNEL);
>
> - if (NULL == hwmgr->dyn_state.cac_dtp_table)
> + if (NULL == hwmgr->dyn_state.cac_dtp_table) {
> + kfree(tdp_table);
> return -ENOMEM;
> + }
>
> memset(hwmgr->dyn_state.cac_dtp_table, 0x00, table_size);
>
> --
> 2.7.3
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] drm/amd/powerplay: fix memory leak of tdp_table Colin King <colin.king@canonical.com> - 2016-03-18 17:50 +0100 Re: [PATCH] drm/amd/powerplay: fix memory leak of tdp_table Alex Deucher <alexdeucher@gmail.com> - 2016-03-18 20:20 +0100
csiph-web