提交 6bf6ded3 编写于 作者: A Andrzej Hajda 提交者: Sebastian Reichel

HSI: omap_ssi: fix handling ida_simple_get result

The function can return negative value.

The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2038576Signed-off-by: NAndrzej Hajda <a.hajda@samsung.com>
Signed-off-by: NSebastian Reichel <sre@kernel.org>
上级 403c5c06
......@@ -323,11 +323,10 @@ static int __init ssi_add_controller(struct hsi_controller *ssi,
return -ENOMEM;
}
ssi->id = ida_simple_get(&platform_omap_ssi_ida, 0, 0, GFP_KERNEL);
if (ssi->id < 0) {
err = ssi->id;
err = ida_simple_get(&platform_omap_ssi_ida, 0, 0, GFP_KERNEL);
if (err < 0)
goto out_err;
}
ssi->id = err;
ssi->owner = THIS_MODULE;
ssi->device.parent = &pd->dev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部