提交 b37457d8 编写于 作者: S Sergei Shtylyov 提交者: Felipe Balbi

usb: musb: omap2430: fix wrong devm_kzalloc() result check

Commit 00a0b1d5 (usb: musb: omap: Add device
tree support for omap musb glue) assigns result of devm_kzalloc() call to
the 'config' variable but then checks for NULL the 'data' variable (already
checked after previous call). Thus we risk a kernel oops further when data
pointed by 'config' is written to by subsequent of_property_read_u32() calls
iff the allocation happens to fail...
Signed-off-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 25736e0c
......@@ -543,7 +543,7 @@ static int omap2430_probe(struct platform_device *pdev)
}
config = devm_kzalloc(&pdev->dev, sizeof(*config), GFP_KERNEL);
if (!data) {
if (!config) {
dev_err(&pdev->dev,
"failed to allocate musb hdrc config\n");
goto err2;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册