提交 0a7fdc59 编写于 作者: T Tommi Rantala 提交者: Dave Airlie

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: NTommi Rantala <tt.rantala@gmail.com>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 bfb82ff0
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册