Subash Patel | 23 Jun 2012 03:12
Picon

[PATCH] DRM: exynos: return NULL if exynos_pages_to_sg fails

From: Subash Patel <subash.rp <at> samsung.com>

exynos_pages_to_sg() internally calls sg_kmalloc() which can return
no pages when the system is under high memory crunch. One such instance
is chromeos-install in the chromeos. This patch adds check for the return
value of the function in subject to return NULL on failure.

Signed-off-by: Subash Patel <subash.ramaswamy <at> linaro.org>
CC: dri-devel <at> lists.freedesktop.org
CC: linux-samsung-soc <at> vger.kernel.org
CC: linaro-mm-sig <at> lists.linaro.org
CC: inki.dae <at> samsung.com
CC: airlied <at> redhat.com
CC: olofj <at> chromium.org
---
 drivers/gpu/drm/exynos/exynos_drm_dmabuf.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
index 97325c1..c908a29 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
 <at>  <at>  -87,6 +87,10  <at>  <at>  static struct sg_table *
 	npages = buf->size / buf->page_size;

 	sgt = exynos_pages_to_sg(buf->pages, npages, buf->page_size);
+	if (!sgt) {
+		DRM_DEBUG_PRIME("exynos_pages_to_sg returned NULL!\n");
+		goto err_unlock;
+	}
(Continue reading)

InKi Dae | 25 Jun 2012 15:44
Picon

Re: [Linaro-mm-sig] [PATCH] DRM: exynos: return NULL if exynos_pages_to_sg fails

Hi Subash,

Could you re-post this patch seperately? your patch includes another one.

Thanks,
Inki Dae

2012/6/23 Subash Patel <subashrp <at> gmail.com>:
> From: Subash Patel <subash.rp <at> samsung.com>
>
> exynos_pages_to_sg() internally calls sg_kmalloc() which can return
> no pages when the system is under high memory crunch. One such instance
> is chromeos-install in the chromeos. This patch adds check for the return
> value of the function in subject to return NULL on failure.
>
> Signed-off-by: Subash Patel <subash.ramaswamy <at> linaro.org>
> CC: dri-devel <at> lists.freedesktop.org
> CC: linux-samsung-soc <at> vger.kernel.org
> CC: linaro-mm-sig <at> lists.linaro.org
> CC: inki.dae <at> samsung.com
> CC: airlied <at> redhat.com
> CC: olofj <at> chromium.org
> ---
>  drivers/gpu/drm/exynos/exynos_drm_dmabuf.c |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
> index 97325c1..c908a29 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
(Continue reading)


Gmane