summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/dce6_afmt.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-09-03 22:03:21 +0400
committerAlex Deucher <alexander.deucher@amd.com>2013-09-11 19:44:25 +0400
commit7cc0a3d85b5d4acb69d60a88de0bd029bef04b4f (patch)
tree33b5f067f0ff85ed945a7d43232fb671fee0aff8 /drivers/gpu/drm/radeon/dce6_afmt.c
parent63580c3e48de1a35ec8847ea24f1acb5aef48608 (diff)
downloadlinux-7cc0a3d85b5d4acb69d60a88de0bd029bef04b4f.tar.xz
drm/radeon/dce6/audio: make sure pin is valid before accessing it
Make sure the audio pin is valid before accessing its members. Noticed by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/dce6_afmt.c')
-rw-r--r--drivers/gpu/drm/radeon/dce6_afmt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/dce6_afmt.c b/drivers/gpu/drm/radeon/dce6_afmt.c
index 8953255e894b..3853dda797dd 100644
--- a/drivers/gpu/drm/radeon/dce6_afmt.c
+++ b/drivers/gpu/drm/radeon/dce6_afmt.c
@@ -86,12 +86,12 @@ void dce6_afmt_select_pin(struct drm_encoder *encoder)
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
u32 offset = dig->afmt->offset;
- u32 id = dig->afmt->pin->id;
if (!dig->afmt->pin)
return;
- WREG32(AFMT_AUDIO_SRC_CONTROL + offset, AFMT_AUDIO_SRC_SELECT(id));
+ WREG32(AFMT_AUDIO_SRC_CONTROL + offset,
+ AFMT_AUDIO_SRC_SELECT(dig->afmt->pin->id));
}
void dce6_afmt_write_speaker_allocation(struct drm_encoder *encoder)