diff options
author | Kevin Brace <kevinbrace@gmx.com> | 2019-04-17 16:08:25 -0700 |
---|---|---|
committer | Kevin Brace <kevinbrace@gmx.com> | 2019-04-17 16:08:25 -0700 |
commit | 22c611d52fc33058c03ad44c43ce3bd687849315 (patch) | |
tree | 558a703a40a2ad6e7e43873d3efa18323a10c6bf | |
parent | 6e59935a7b93135e23e2b81f4c6e5c1ec9da369d (diff) | |
download | xorg-driver-xf86-video-cirrus-22c611d52fc33058c03ad44c43ce3bd687849315.tar.gz |
Check for a successful transmission of EDID for Laguna I2C bus code
The existing code can potentially cause a null pointer crash if EDID
was not obtained successfully.
Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
-rw-r--r-- | src/lg_driver.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lg_driver.c b/src/lg_driver.c index be8963a..1042030 100644 --- a/src/lg_driver.c +++ b/src/lg_driver.c @@ -360,6 +360,12 @@ LgDoDDC(ScrnInfoPtr pScrn) * Read and output monitor info using DDC2 over I2C bus. */ MonInfo = xf86DoEDID_DDC2(XF86_SCRN_ARG(pScrn), pCir->I2CPtr1); + if (!MonInfo) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Failed to obtain EDID.\n"); + goto unmap_out; + } + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "I2C Monitor info: %p\n", (void *)MonInfo); xf86PrintEDID(MonInfo); |