Eric Sesterhenn
d5ce1379be
[PATCH] USB: negative index in drivers/usb/host/isp116x-hcd.c
...
From: Eric Sesterhenn <snakebyte@gmx.de >
This fixes coverity Bug #390 .
With the following code
ret = ep->branch = balance(isp116x, ep->period, ep->load);
if (ret < 0)
goto fail;
the problem is that ret and balance are of the type int, and ep->branch is u16.
so the int balance() returns gets reduced to u16 and then converted to an int again,
which removes the sign. Maybe the following little c program can explain it better:
2006-06-21 15:04:15 -07:00
..
2006-06-19 18:05:09 -07:00
2006-06-20 01:21:29 -07:00
2006-06-21 12:40:49 -07:00
2006-06-21 15:04:14 -07:00
2006-03-31 17:26:33 +02:00
2006-06-17 10:44:26 -07:00
2006-06-21 12:40:47 -07:00
2006-06-19 23:42:53 -07:00
2006-06-04 19:47:38 -04:00
2006-03-21 20:14:08 +11:00
2006-03-25 08:22:53 -08:00
2006-06-17 21:25:58 -07:00
2006-05-03 20:05:41 -07:00
2006-03-25 08:23:01 -08:00
2006-06-20 01:21:29 -07:00
2006-04-14 11:41:25 -07:00
2006-04-14 11:18:33 -07:00
2006-05-26 11:55:46 -07:00
2006-06-20 01:21:29 -07:00
2006-06-20 20:01:16 -07:00
2006-06-19 19:01:59 -07:00
2006-05-29 23:31:12 -04:00
2006-06-21 12:40:47 -07:00
2006-06-19 13:08:39 +01:00
2006-04-21 22:34:26 +10:00
2006-05-31 16:27:11 -07:00
2006-06-17 21:30:14 -07:00
2006-06-21 11:18:25 -07:00
2006-03-24 07:33:28 -08:00
2006-03-28 09:16:06 -08:00
2006-06-12 22:10:22 +01:00
2006-06-20 20:31:24 +01:00
2006-06-20 17:57:28 -07:00
2006-03-28 09:16:05 -08:00
2006-04-21 22:20:33 +00:00
2006-06-18 13:00:48 +01:00
2006-06-21 11:23:13 -07:00
2006-06-19 15:37:31 +01:00
2006-04-19 09:13:52 -07:00
2006-06-05 12:29:17 -07:00
2006-06-21 11:18:25 -07:00
2006-06-20 01:21:29 -07:00
2006-06-21 11:18:25 -07:00
2006-06-20 17:52:36 -07:00
2006-05-03 20:05:41 -07:00
2006-05-26 11:55:46 -07:00
2006-03-23 07:38:16 -08:00
2006-03-31 17:26:33 +02:00
2006-06-21 15:04:15 -07:00
2006-06-20 14:49:00 -07:00
2006-03-24 18:23:14 +01:00
2006-03-25 08:22:53 -08:00
2006-06-17 21:18:43 -07:00
2006-06-17 21:18:43 -07:00