[PATCH] Radeon skip bogus output_id 0

Stefan Assmann sassmann at redhat.com
Thu Apr 1 06:39:53 PDT 2010


From: Stefan Assmann <sassmann at redhat.com>

Parsing the BIOSConnectorTable created some bogus entries
with an output_id of 0 (mobility radeon x700). That caused
RADEONLookupGPIOLineForDDC to generate uninitalized i2c entries,
which finally provoked a segfault in RADEONI2CDoLock. To prevent
this add a check for that skips output_ids of 0.

Program received signal SIGSEGV, Segmentation fault.
RADEONI2CDoLock (output=0x82548e0, b=0x8254b18, lock_state=1) at radeon_output.c:1888
1888        OUTREG(pRADEONI2CBus->mask_clk_reg, temp);
(gdb) bt
0  RADEONI2CDoLock (output=0x82548e0, b=0x8254b18, lock_state=1) at radeon_output.c:1888
1  0xb71d392c in radeon_ddc_connected (output=0x82548e0) at radeon_output.c:332
2  radeon_detect (output=0x82548e0) at radeon_output.c:1170
3  0xb71876ec in RADEONPreInitControllers (pScrn=<value optimized out>) at radeon_driver.c:2892
4  0xb7189a8f in RADEONPreInit (pScrn=0x8256998, flags=0) at radeon_driver.c:3158
5  0x080be944 in InitOutput (pScreenInfo=0x82366a0, argc=1, argv=0xbfc3b884) at xf86Init.c:832
6  0x080666eb in main (argc=1, argv=0xbfc3b884, envp=0xbfc3b88c) at main.c:205

Signed-off-by: Stefan Assmann <sassmann at redhat.com>
---
 src/radeon_atombios.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c
index bbe3d8e..cf13eff 100644
--- a/src/radeon_atombios.c
+++ b/src/radeon_atombios.c
@@ -2533,6 +2533,10 @@ RADEONGetATOMConnectorInfoFromBIOSConnectorTable (ScrnInfoPtr pScrn)
 	    continue;
 	}

+	/* skip bogus output_id of 0 */
+	if (info->BiosConnector[i].output_id == 0)
+	    return FALSE;
+
 	/* don't assign a gpio for tv */
 	if ((i == ATOM_DEVICE_TV1_INDEX) ||
 	    (i == ATOM_DEVICE_TV2_INDEX) ||
-- 
1.7.0.2



More information about the xorg-driver-ati mailing list