diff options
author | Dave Airlie | 2016-12-23 05:26:55 +1000 |
---|---|---|
committer | Dave Airlie | 2016-12-23 05:26:55 +1000 |
commit | d043835d08b297a41275e4dd499a33dd57243dee (patch) | |
tree | fe601c840b4db73d91337f28e1a93537a3edc8e7 /drivers | |
parent | 6df383cf9010feed788bf8ce555d77bcc03ed3a8 (diff) | |
parent | 298360af3dab45659810fdc51aba0c9f4097e4f6 (diff) |
Merge tag 'drm-misc-fixes-2016-12-22' of git://anongit.freedesktop.org/git/drm-misc into drm-fixes
Here's the one lonely bugfix I talked about on irc.
* tag 'drm-misc-fixes-2016-12-22' of git://anongit.freedesktop.org/git/drm-misc:
drivers/gpu/drm/ast: Fix infinite loop if read fails
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/ast/ast_main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c index 904beaa932d0..f75c6421db62 100644 --- a/drivers/gpu/drm/ast/ast_main.c +++ b/drivers/gpu/drm/ast/ast_main.c @@ -223,7 +223,8 @@ static int ast_get_dram_info(struct drm_device *dev) ast_write32(ast, 0x10000, 0xfc600309); do { - ; + if (pci_channel_offline(dev->pdev)) + return -EIO; } while (ast_read32(ast, 0x10000) != 0x01); data = ast_read32(ast, 0x10004); @@ -428,7 +429,9 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags) ast_detect_chip(dev, &need_post); if (ast->chip != AST1180) { - ast_get_dram_info(dev); + ret = ast_get_dram_info(dev); + if (ret) + goto out_free; ast->vram_size = ast_get_vram_info(dev); DRM_INFO("dram %d %d %d %08x\n", ast->mclk, ast->dram_type, ast->dram_bus_width, ast->vram_size); } |