From: Henning Schild <henning@hennsch.de>
To: linux-kernel@vger.kernel.org
Cc: "Henning Schild" <henning@hennsch.de>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Rafał Miłecki" <zajec5@gmail.com>
Subject: [PATCH] drm/radeon: fix dangling pointer kfree
Date: Sat, 11 Oct 2014 14:37:47 +0200 [thread overview]
Message-ID: <1413031067-26961-1-git-send-email-henning@hennsch.de> (raw)
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
next reply other threads:[~2014-10-11 12:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-11 12:37 Henning Schild [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1413031067-26961-1-git-send-email-henning@hennsch.de \
--to=henning@hennsch.de \
--cc=alexander.deucher@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=zajec5@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®