Skip to contentSkip to conversation

request for 4.14-stable: ffdf16edfbbe ("drm/i915/gvt: fix memory leak of a cmd_entry struct on error exit path")

PATCH Applied Sudip Mukherjee 3 participants 4 messages Oct 23, 2018 – Nov 2, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hi Greg,

This was not marked for stable but seems it should be in stable. Please apply to your queue of 4.14-stable.

--
Regards
Sudip

Quoted 1 line

From 2f98e9fe07c5ed6a36646f71e7eb5486ca17db3e Mon Sep 17 00:00:00 2001

From: Colin Ian King <[email protected]>
Date: Tue, 10 Apr 2018 13:33:12 +0100
Subject: [PATCH] drm/i915/gvt: fix memory leak of a cmd_entry struct on error
exit path

commit ffdf16edfbbe77f5f5c3c87fe8d7387ecd16241b upstream

The error exit path when a duplicate is found does not kfree and cmd_entry struct and hence there is a small memory leak. Fix this by kfree'ing it.

Detected by CoverityScan, CID#1370198 ("Resource Leak")

Fixes be1da7070aea ("drm/i915/gvt: vGPU command scanner")
---
 drivers/gpu/drm/i915/gvt/cmd_parser.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/gvt/cmd_parser.c +1 -0
index d4726a3358a4..d6993c2707d1 100644
@@ -2802,6 +2802,7 @@ static int init_cmd_table(struct intel_gvt *gvt)
 		if (info) {
 			gvt_err("%s %s duplicated\n", e->info->name,
 					info->name);
+			kfree(e);
 			return -EEXIST;
 		}
 
Signature · 1 line
2.11.0
maintainer
#1 lore raw
Quoted 4 lines · Sudip Mukherjee

Hi Greg,

This was not marked for stable but seems it should be in stable. Please apply to your queue of 4.14-stable.

Hi Sudip,

The i915 maintainers want to explicitly tag patches for stable, and avoid backporting non-tagged patches.

I can queue it up if one of the maintainers will ack it.

--
Thanks,
Sasha

Acked-by
#2 lore raw
Quoted 6 lines · Sasha Levin
Quoted 4 lines · Sudip Mukherjee

Hi Greg,

This was not marked for stable but seems it should be in stable. Please apply to your queue of 4.14-stable.

Quoted 7 lines

Hi Sudip,

The i915 maintainers want to explicitly tag patches for stable, and avoid backporting non-tagged patches.

I can queue it up if one of the maintainers will ack it.

It looks good to me for backport.

thanks

Signature · 3 lines
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
maintainer Applied
#3 lore raw
Quoted 12 lines · Zhenyu Wang
Quoted 11 lines · Sasha Levin
Quoted 4 lines · Sudip Mukherjee

Hi Greg,

This was not marked for stable but seems it should be in stable. Please apply to your queue of 4.14-stable.

Hi Sudip,

The i915 maintainers want to explicitly tag patches for stable, and avoid backporting non-tagged patches.

Quoted 6 lines
Quoted 2 lines

I can queue it up if one of the maintainers will ack it.

It looks good to me for backport.

Queued up, thanks!

--
Thanks,
Sasha