drm/radeon: initialize sadb to NULL in the audio code
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 13 Oct 2014 17:23:48 +0000 (13:23 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 16 Oct 2014 22:34:06 +0000 (18:34 -0400)
Fixes kfree of the sadb buffer when it's NULL.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/dce3_1_afmt.c
drivers/gpu/drm/radeon/dce6_afmt.c
drivers/gpu/drm/radeon/evergreen_hdmi.c

index 950af153f30e7a53748a0cdb943b9457db468f26..6b1dbecdd36db99bb3433090d11d80fde8707555 100644 (file)
@@ -32,7 +32,7 @@ static void dce3_2_afmt_write_speaker_allocation(struct drm_encoder *encoder)
        struct drm_connector *connector;
        struct radeon_connector *radeon_connector = NULL;
        u32 tmp;
-       u8 *sadb;
+       u8 *sadb = NULL;
        int sad_count;
 
        list_for_each_entry(connector, &encoder->dev->mode_config.connector_list, head) {
index c0bbf68dbc274f4d2055ea8f19850cdf3f6c747f..960a5f0f042f05bde65c2e0405f86e756ba826be 100644 (file)
@@ -155,7 +155,7 @@ void dce6_afmt_write_speaker_allocation(struct drm_encoder *encoder)
        struct drm_connector *connector;
        struct radeon_connector *radeon_connector = NULL;
        u32 offset, tmp;
-       u8 *sadb;
+       u8 *sadb = NULL;
        int sad_count;
 
        if (!dig || !dig->afmt || !dig->afmt->pin)
index 2514d659b1ba1783fb4c6474ea6e45d0b3a1b941..f6a5c3026f859e128d80f4368490679d00200e33 100644 (file)
@@ -133,7 +133,7 @@ static void dce4_afmt_write_speaker_allocation(struct drm_encoder *encoder)
        struct drm_connector *connector;
        struct radeon_connector *radeon_connector = NULL;
        u32 tmp;
-       u8 *sadb;
+       u8 *sadb = NULL;
        int sad_count;
 
        list_for_each_entry(connector, &encoder->dev->mode_config.connector_list, head) {