Commit 43b1e9c9 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/device: return proper error codes if ioremap fails

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent c4837d27
...@@ -139,8 +139,8 @@ nouveau_devobj_ctor(struct nouveau_object *parent, ...@@ -139,8 +139,8 @@ nouveau_devobj_ctor(struct nouveau_object *parent,
if (!(args->disable & NV_DEVICE_DISABLE_IDENTIFY) && if (!(args->disable & NV_DEVICE_DISABLE_IDENTIFY) &&
!device->card_type) { !device->card_type) {
map = ioremap(mmio_base, 0x102000); map = ioremap(mmio_base, 0x102000);
if (map == NULL) { if (map == NULL)
} return -ENOMEM;
/* switch mmio to cpu's native endianness */ /* switch mmio to cpu's native endianness */
#ifndef __BIG_ENDIAN #ifndef __BIG_ENDIAN
...@@ -230,7 +230,7 @@ nouveau_devobj_ctor(struct nouveau_object *parent, ...@@ -230,7 +230,7 @@ nouveau_devobj_ctor(struct nouveau_object *parent,
nv_subdev(device)->mmio = ioremap(mmio_base, mmio_size); nv_subdev(device)->mmio = ioremap(mmio_base, mmio_size);
if (!nv_subdev(device)->mmio) { if (!nv_subdev(device)->mmio) {
nv_error(device, "unable to map device registers\n"); nv_error(device, "unable to map device registers\n");
return ret; return -ENOMEM;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment