Skip to content

Commit 9b2788d

Browse files
committed
Merge tag 'drm-misc-next-fixes-2021-04-29' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
Two patches in drm-misc-next-fixes this week, one to fix the error handling in TTM when a BO can't be swapped out and one to prevent a wrong dereference in efifb. Signed-off-by: Dave Airlie <[email protected]> From: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20210429090308.k3fuqvenf6vupfmg@gilmour
2 parents 12fc11b + 74deef0 commit 9b2788d

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

drivers/gpu/drm/ttm/ttm_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ int ttm_global_swapout(struct ttm_operation_ctx *ctx, gfp_t gfp_flags)
112112
{
113113
struct ttm_global *glob = &ttm_glob;
114114
struct ttm_device *bdev;
115-
int ret = -EBUSY;
115+
int ret = 0;
116116

117117
mutex_lock(&ttm_global_mutex);
118118
list_for_each_entry(bdev, &glob->device_list, device_list) {

drivers/gpu/drm/ttm/ttm_tt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ int ttm_tt_populate(struct ttm_device *bdev,
329329
ttm_dma32_pages_limit) {
330330

331331
ret = ttm_global_swapout(ctx, GFP_KERNEL);
332+
if (ret == 0)
333+
break;
332334
if (ret < 0)
333335
goto error;
334336
}

drivers/gpu/drm/vmwgfx/ttm_memory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ static void ttm_shrink(struct ttm_mem_global *glob, bool from_wq,
280280
spin_unlock(&glob->lock);
281281
ret = ttm_global_swapout(ctx, GFP_KERNEL);
282282
spin_lock(&glob->lock);
283-
if (unlikely(ret < 0))
283+
if (unlikely(ret <= 0))
284284
break;
285285
}
286286

drivers/video/fbdev/efifb.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,8 @@ static int efifb_probe(struct platform_device *dev)
575575
goto err_fb_dealoc;
576576
}
577577
fb_info(info, "%s frame buffer device\n", info->fix.id);
578-
pm_runtime_get_sync(&efifb_pci_dev->dev);
578+
if (efifb_pci_dev)
579+
pm_runtime_get_sync(&efifb_pci_dev->dev);
579580
return 0;
580581

581582
err_fb_dealoc:
@@ -602,7 +603,8 @@ static int efifb_remove(struct platform_device *pdev)
602603
unregister_framebuffer(info);
603604
sysfs_remove_groups(&pdev->dev.kobj, efifb_groups);
604605
framebuffer_release(info);
605-
pm_runtime_put(&efifb_pci_dev->dev);
606+
if (efifb_pci_dev)
607+
pm_runtime_put(&efifb_pci_dev->dev);
606608

607609
return 0;
608610
}

0 commit comments

Comments
 (0)