From: Ben Skeggs Date: Tue, 5 Aug 2014 12:03:49 +0000 (+1000) Subject: drm/nv50-/fb: use dma_mapping_error() to check dma_map_page() result X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=838f6fe7e470b7cd322b7c3e5ac8c0e09e580194;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git drm/nv50-/fb: use dma_mapping_error() to check dma_map_page() result Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c b/drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c index 7d88e17fa927..4150b0d10af8 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c +++ b/drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c @@ -253,8 +253,8 @@ nv50_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine, priv->r100c08 = dma_map_page(nv_device_base(device), priv->r100c08_page, 0, PAGE_SIZE, DMA_BIDIRECTIONAL); - if (!priv->r100c08) - nv_warn(priv, "failed 0x100c08 page map\n"); + if (dma_mapping_error(nv_device_base(device), priv->r100c08)) + return -EFAULT; } else { nv_warn(priv, "failed 0x100c08 page alloc\n"); } diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c b/drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c index 9f5f3ac8d4c6..b19a2b3c1081 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c +++ b/drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c @@ -97,7 +97,7 @@ nvc0_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine, priv->r100c10 = dma_map_page(nv_device_base(device), priv->r100c10_page, 0, PAGE_SIZE, DMA_BIDIRECTIONAL); - if (!priv->r100c10) + if (dma_mapping_error(nv_device_base(device), priv->r100c10)) return -EFAULT; }