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 <airlied@redhat.com>

From: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20210429090308.k3fuqvenf6vupfmg@gilmour

+8 -4
+1 -1
drivers/gpu/drm/ttm/ttm_device.c
··· 112 112 { 113 113 struct ttm_global *glob = &ttm_glob; 114 114 struct ttm_device *bdev; 115 - int ret = -EBUSY; 115 + int ret = 0; 116 116 117 117 mutex_lock(&ttm_global_mutex); 118 118 list_for_each_entry(bdev, &glob->device_list, device_list) {
+2
drivers/gpu/drm/ttm/ttm_tt.c
··· 329 329 ttm_dma32_pages_limit) { 330 330 331 331 ret = ttm_global_swapout(ctx, GFP_KERNEL); 332 + if (ret == 0) 333 + break; 332 334 if (ret < 0) 333 335 goto error; 334 336 }
+1 -1
drivers/gpu/drm/vmwgfx/ttm_memory.c
··· 280 280 spin_unlock(&glob->lock); 281 281 ret = ttm_global_swapout(ctx, GFP_KERNEL); 282 282 spin_lock(&glob->lock); 283 - if (unlikely(ret < 0)) 283 + if (unlikely(ret <= 0)) 284 284 break; 285 285 } 286 286
+4 -2
drivers/video/fbdev/efifb.c
··· 575 575 goto err_fb_dealoc; 576 576 } 577 577 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); 579 580 return 0; 580 581 581 582 err_fb_dealoc: ··· 603 602 unregister_framebuffer(info); 604 603 sysfs_remove_groups(&pdev->dev.kobj, efifb_groups); 605 604 framebuffer_release(info); 606 - pm_runtime_put(&efifb_pci_dev->dev); 605 + if (efifb_pci_dev) 606 + pm_runtime_put(&efifb_pci_dev->dev); 607 607 608 608 return 0; 609 609 }