Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a7fdc59 authored by Tommi Rantala's avatar Tommi Rantala Committed by Dave Airlie
Browse files

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: default avatarTommi Rantala <tt.rantala@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent bfb82ff0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);