diff options
author | Ivan Bornyakov <brnkv.i1@gmail.com> | 2018-05-25 20:49:52 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-06-26 03:08:05 +0300 |
commit | 5dbffe420164137f8b6b733de3d801019d777fa4 (patch) | |
tree | 04b17ee4ad4c8166a0eb4f4ee5ab69ce599ef459 /drivers/atm | |
parent | 46bada0a9367ad54eda95669bec8efc078ecce51 (diff) | |
download | linux-5dbffe420164137f8b6b733de3d801019d777fa4.tar.xz |
atm: zatm: fix memcmp casting
[ Upstream commit f9c6442a8f0b1dde9e755eb4ff6fa22bcce4eabc ]
memcmp() returns int, but eprom_try_esi() cast it to unsigned char. One
can lose significant bits and get 0 from non-0 value returned by the
memcmp().
Signed-off-by: Ivan Bornyakov <brnkv.i1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/atm')
-rw-r--r-- | drivers/atm/zatm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c index 81bfeec67b77..d0fac641e717 100644 --- a/drivers/atm/zatm.c +++ b/drivers/atm/zatm.c @@ -1151,8 +1151,8 @@ static void eprom_get_byte(struct zatm_dev *zatm_dev, unsigned char *byte, } -static unsigned char eprom_try_esi(struct atm_dev *dev, unsigned short cmd, - int offset, int swap) +static int eprom_try_esi(struct atm_dev *dev, unsigned short cmd, int offset, + int swap) { unsigned char buf[ZEPROM_SIZE]; struct zatm_dev *zatm_dev; |