All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/gma500: fix memory leak on edid
@ 2017-03-20 17:56 ` Colin King
  0 siblings, 0 replies; 5+ messages in thread
From: Colin King @ 2017-03-20 17:56 UTC (permalink / raw)
  To: Patrik Jakobsson, David Airlie, dri-devel; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

edid is allocated on the call to psb_intel_sdvo_get_edid but not
kfree'd at all, causing a memory leak.  Fix this by kfree'ing
the edid.  (This may be null, but kfree can handle null frees).

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

Fixes: 5736995b473b ("gma500: Replace SDVO code with slightly modified version from i915")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/gma500/psb_intel_sdvo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/gma500/psb_intel_sdvo.c b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
index e787d376ba67..f38e6ad1ab9b 100644
--- a/drivers/gpu/drm/gma500/psb_intel_sdvo.c
+++ b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
@@ -1650,6 +1650,7 @@ static bool psb_intel_sdvo_detect_hdmi_audio(struct drm_connector *connector)
 	edid = psb_intel_sdvo_get_edid(connector);
 	if (edid != NULL && edid->input & DRM_EDID_INPUT_DIGITAL)
 		has_audio = drm_detect_monitor_audio(edid);
+	kfree(edid);
 
 	return has_audio;
 }
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-03-20 18:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-20 17:56 [PATCH] drm/gma500: fix memory leak on edid Colin King
2017-03-20 17:56 ` Colin King
2017-03-20 18:30 ` walter harms
2017-03-20 18:30   ` walter harms
2017-03-20 18:30   ` walter harms

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.