浏览代码

video: fbdev: pxafb: fix out of memory error path

As seen by Julia, the initial allocation memory is not checked anymore
after commit "video: fbdev: pxafb: initial devicetree conversion".
Introduce back the removed test.

Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Robert Jarzmik 9 年之前
父节点
当前提交
6f6abd3606
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      drivers/video/fbdev/pxafb.c

+ 2 - 0
drivers/video/fbdev/pxafb.c

@@ -2249,6 +2249,8 @@ static int pxafb_probe(struct platform_device *dev)
 	ret = -ENOMEM;
 	pdata = dev_get_platdata(&dev->dev);
 	inf = devm_kmalloc(&dev->dev, sizeof(*inf), GFP_KERNEL);
+	if (!inf)
+		goto failed;
 
 	if (pdata) {
 		*inf = *pdata;