Skip to content

Commit

Permalink
atm: zatm: fix memcmp casting
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
i1brnkv authored and davem330 committed May 29, 2018
1 parent 3125642 commit f9c6442
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/atm/zatm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f9c6442

Please sign in to comment.