diff options
author | Tommi Rantala <tt.rantala@gmail.com> | 2012-11-09 09:19:36 +0000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-11-20 16:06:24 +1000 |
commit | 0a7fdc59fba559dfbce14963b32102125c49cb10 (patch) | |
tree | 5185df71f82bb0a0bf4fe8dea0f7a066409e9bf8 /drivers/gpu/drm/mgag200 | |
parent | bfb82ff0ee1dd0d1eed45ee25aa601f4ea5c54ac (diff) |
drm/mgag200: check alloc_apertures() success in mga_vram_init()
Check for alloc_apertures() memory allocation failure, and propagate an
error code in case the allocation failed.
Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/mgag200')
-rw-r--r-- | drivers/gpu/drm/mgag200/mgag200_main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c index d6a1aae33701..07d4b24d4fff 100644 --- a/drivers/gpu/drm/mgag200/mgag200_main.c +++ b/drivers/gpu/drm/mgag200/mgag200_main.c @@ -133,6 +133,8 @@ static int mga_vram_init(struct mga_device *mdev) { void __iomem *mem; struct apertures_struct *aper = alloc_apertures(1); + if (!aper) + return -ENOMEM; /* BAR 0 is VRAM */ mdev->mc.vram_base = pci_resource_start(mdev->dev->pdev, 0); |