提交 f9c6442a 编写于 作者: I Ivan Bornyakov 提交者: David S. Miller

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: NIvan Bornyakov <brnkv.i1@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 31256426
...@@ -1151,8 +1151,8 @@ static void eprom_get_byte(struct zatm_dev *zatm_dev, unsigned char *byte, ...@@ -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, static int eprom_try_esi(struct atm_dev *dev, unsigned short cmd, int offset,
int offset, int swap) int swap)
{ {
unsigned char buf[ZEPROM_SIZE]; unsigned char buf[ZEPROM_SIZE];
struct zatm_dev *zatm_dev; struct zatm_dev *zatm_dev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册