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.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYIp2LgAKCRDj7w1vZxhR
 xTf4AQCl1aaOBAQiE6+smrtTGoaz5dhaOmBYdEfPBINdZUy2QgD9GZlYKDUUcvFn
 5eQmjrYBIoSd+cRIuA1Q1Vs+UVs0hAI=
 =21w+
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Dave Airlie 2021-04-30 10:13:08 +10:00
Родитель 12fc11bce6 74deef03a4
Коммит 9b2788dbce
4 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -112,7 +112,7 @@ int ttm_global_swapout(struct ttm_operation_ctx *ctx, gfp_t gfp_flags)
{
struct ttm_global *glob = &ttm_glob;
struct ttm_device *bdev;
int ret = -EBUSY;
int ret = 0;
mutex_lock(&ttm_global_mutex);
list_for_each_entry(bdev, &glob->device_list, device_list) {

Просмотреть файл

@ -329,6 +329,8 @@ int ttm_tt_populate(struct ttm_device *bdev,
ttm_dma32_pages_limit) {
ret = ttm_global_swapout(ctx, GFP_KERNEL);
if (ret == 0)
break;
if (ret < 0)
goto error;
}

Просмотреть файл

@ -280,7 +280,7 @@ static void ttm_shrink(struct ttm_mem_global *glob, bool from_wq,
spin_unlock(&glob->lock);
ret = ttm_global_swapout(ctx, GFP_KERNEL);
spin_lock(&glob->lock);
if (unlikely(ret < 0))
if (unlikely(ret <= 0))
break;
}

Просмотреть файл

@ -575,7 +575,8 @@ static int efifb_probe(struct platform_device *dev)
goto err_fb_dealoc;
}
fb_info(info, "%s frame buffer device\n", info->fix.id);
pm_runtime_get_sync(&efifb_pci_dev->dev);
if (efifb_pci_dev)
pm_runtime_get_sync(&efifb_pci_dev->dev);
return 0;
err_fb_dealoc:
@ -602,7 +603,8 @@ static int efifb_remove(struct platform_device *pdev)
unregister_framebuffer(info);
sysfs_remove_groups(&pdev->dev.kobj, efifb_groups);
framebuffer_release(info);
pm_runtime_put(&efifb_pci_dev->dev);
if (efifb_pci_dev)
pm_runtime_put(&efifb_pci_dev->dev);
return 0;
}