提交 29160019 编写于 作者: P Pavel Shved 提交者: Paul Mundt

hecubafb: add module_put on error path in hecubafb_probe()

In hecubafb_probe(), after a successful try_module_get, vzalloc may
fail and make the hecubafb_probe return, but the module is not put on
this error path.

This patch adds an exit point that calls module_put in such situation.

Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: NPavel Shved <shved@ispras.ru>
Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
上级 9845afc8
......@@ -233,7 +233,7 @@ static int __devinit hecubafb_probe(struct platform_device *dev)
videomemory = vzalloc(videomemorysize);
if (!videomemory)
return retval;
goto err_videomem_alloc;
info = framebuffer_alloc(sizeof(struct hecubafb_par), &dev->dev);
if (!info)
......@@ -275,6 +275,7 @@ static int __devinit hecubafb_probe(struct platform_device *dev)
framebuffer_release(info);
err_fballoc:
vfree(videomemory);
err_videomem_alloc:
module_put(board->owner);
return retval;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册