Skip to content

Commit

Permalink
drm/nouveau/device: return proper error codes if ioremap fails
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Oct 3, 2012
1 parent c4837d2 commit 43b1e9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/nouveau/core/subdev/device/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ nouveau_devobj_ctor(struct nouveau_object *parent,
if (!(args->disable & NV_DEVICE_DISABLE_IDENTIFY) &&
!device->card_type) {
map = ioremap(mmio_base, 0x102000);
if (map == NULL) {
}
if (map == NULL)
return -ENOMEM;

/* switch mmio to cpu's native endianness */
#ifndef __BIG_ENDIAN
Expand Down Expand Up @@ -230,7 +230,7 @@ nouveau_devobj_ctor(struct nouveau_object *parent,
nv_subdev(device)->mmio = ioremap(mmio_base, mmio_size);
if (!nv_subdev(device)->mmio) {
nv_error(device, "unable to map device registers\n");
return ret;
return -ENOMEM;
}
}

Expand Down

0 comments on commit 43b1e9c

Please sign in to comment.