diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2015-09-21 09:33:43 -0400 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2016-01-07 10:06:22 -0500 |
commit | 6bf6ded3008a407ccab5ad72eb59ab71b97cc290 (patch) | |
tree | fb6e5de8a0a0826ea2ec8743d899d03e8cfd6137 /drivers/hsi | |
parent | 403c5c0650816375527a6feecfb255d9b494dda3 (diff) |
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/2038576
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/hsi')
-rw-r--r-- | drivers/hsi/controllers/omap_ssi.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/hsi/controllers/omap_ssi.c b/drivers/hsi/controllers/omap_ssi.c index f6d3100b7a32..27b91f14ba7a 100644 --- a/drivers/hsi/controllers/omap_ssi.c +++ b/drivers/hsi/controllers/omap_ssi.c | |||
@@ -323,11 +323,10 @@ static int __init ssi_add_controller(struct hsi_controller *ssi, | |||
323 | return -ENOMEM; | 323 | return -ENOMEM; |
324 | } | 324 | } |
325 | 325 | ||
326 | ssi->id = ida_simple_get(&platform_omap_ssi_ida, 0, 0, GFP_KERNEL); | 326 | err = ida_simple_get(&platform_omap_ssi_ida, 0, 0, GFP_KERNEL); |
327 | if (ssi->id < 0) { | 327 | if (err < 0) |
328 | err = ssi->id; | ||
329 | goto out_err; | 328 | goto out_err; |
330 | } | 329 | ssi->id = err; |
331 | 330 | ||
332 | ssi->owner = THIS_MODULE; | 331 | ssi->owner = THIS_MODULE; |
333 | ssi->device.parent = &pd->dev; | 332 | ssi->device.parent = &pd->dev; |