Skip to content

Commit f9c6442

Browse files
i1brnkvdavem330
authored andcommitted
atm: zatm: fix memcmp casting
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]>
1 parent 3125642 commit f9c6442

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/atm/zatm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,8 +1151,8 @@ static void eprom_get_byte(struct zatm_dev *zatm_dev, unsigned char *byte,
11511151
}
11521152

11531153

1154-
static unsigned char eprom_try_esi(struct atm_dev *dev, unsigned short cmd,
1155-
int offset, int swap)
1154+
static int eprom_try_esi(struct atm_dev *dev, unsigned short cmd, int offset,
1155+
int swap)
11561156
{
11571157
unsigned char buf[ZEPROM_SIZE];
11581158
struct zatm_dev *zatm_dev;

0 commit comments

Comments
 (0)