mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/radeon: fix dangling pointer kfree
@ 2014-10-11 12:37 Henning Schild
  2014-10-11 12:51 ` [PATCH] drm/radeon: remove code that can never get executed Henning Schild
  0 siblings, 1 reply; 6+ messages in thread
From: Henning Schild @ 2014-10-11 12:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: Henning Schild, Alex Deucher, Rafał Miłecki

If drm_edid_to_speaker_allocation returns a count of 0 sadb is not
initialized and should not get kfreed. Bail out like the other two
callers.

Signed-off-by: Henning Schild <henning@hennsch.de>
---
 drivers/gpu/drm/radeon/dce3_1_afmt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/dce3_1_afmt.c b/drivers/gpu/drm/radeon/dce3_1_afmt.c
index 51800e3..cb76074 100644
--- a/drivers/gpu/drm/radeon/dce3_1_afmt.c
+++ b/drivers/gpu/drm/radeon/dce3_1_afmt.c
@@ -48,7 +48,7 @@ static void dce3_2_afmt_write_speaker_allocation(struct drm_encoder *encoder)
 	}
 
 	sad_count = drm_edid_to_speaker_allocation(radeon_connector->edid, &sadb);
-	if (sad_count < 0) {
+	if (sad_count <= 0) {
 		DRM_ERROR("Couldn't read Speaker Allocation Data Block: %d\n", sad_count);
 		return;
 	}
-- 
2.0.4


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

end of thread, other threads:[~2014-10-13 17:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-11 12:37 [PATCH] drm/radeon: fix dangling pointer kfree Henning Schild
2014-10-11 12:51 ` [PATCH] drm/radeon: remove code that can never get executed Henning Schild
2014-10-13 16:08   ` Deucher, Alexander
2014-10-13 16:44     ` Henning Schild
2014-10-13 17:31       ` Deucher, Alexander
2014-10-13 17:54         ` Henning Schild

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome