Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/exynos: fix return value check in lowlevel_buffer_allocate()

In case of error, the function drm_prime_pages_to_sg() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Inki Dae <inki.dae@samsung.com>

authored by

Wei Yongjun and committed by
Inki Dae
662bb699 fafb3837

+2 -2
+2 -2
drivers/gpu/drm/exynos/exynos_drm_buf.c
··· 91 91 } 92 92 93 93 buf->sgt = drm_prime_pages_to_sg(buf->pages, nr_pages); 94 - if (!buf->sgt) { 94 + if (IS_ERR(buf->sgt)) { 95 95 DRM_ERROR("failed to get sg table.\n"); 96 - ret = -ENOMEM; 96 + ret = PTR_ERR(buf->sgt); 97 97 goto err_free_attrs; 98 98 } 99 99