diff options
author | Simon Glass | 2014-02-27 13:26:11 -0700 |
---|---|---|
committer | Simon Glass | 2014-03-17 20:05:47 -0600 |
commit | 2ab83f0d7522e34f6a67e6ed80f7ba03aa7c8dd6 (patch) | |
tree | 0d04b1b5f5b38969fa4c923a691b3483a0d0dd23 /drivers/usb/eth | |
parent | a60702833150b8f9263a5f1fb9a6b64774cd44f3 (diff) |
cros_ec: Correct comparison between signed and unsigned numbers
Due to signed/unsigned comparison, '< sizeof(struct)' does not do the right
thing, since if ec_command() returns a -ve number we will consider this be
success.
Adjust all comparisons to avoid this problem.
This error was found with sandbox, which gives a segfault in this case. On
ARM we may instead silently fail.
We should also consider turning on -Wsign-compare to catch this sort of thing
in future.
Reviewed-by: Andrew Chew <achew@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Andrew Chew <achew@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jimmy Zhang <jimmzhang@nvidia.com>
Diffstat (limited to 'drivers/usb/eth')
0 files changed, 0 insertions, 0 deletions