Messages in this thread Patch in this message | | | From | Henning Schild <> | Subject | [PATCH] drm/radeon: fix dangling pointer kfree | Date | Sat, 11 Oct 2014 14:37:47 +0200 |
| |
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
| |