summaryrefslogtreecommitdiffstats
path: root/drivers/atm
diff options
context:
space:
mode:
authorIvan Bornyakov <brnkv.i1@gmail.com>2018-05-25 20:49:52 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-08 15:30:52 +0200
commitd20dcd2f11357f2b0f52a243e4737c129240475d (patch)
treec6c73f5ea0b9e88c7639a8b5ab0ab86b08a74ce5 /drivers/atm
parent3ee6bd9411a60f90b5adeea5440cbac302c3e9d0 (diff)
downloadlinux-stable-d20dcd2f11357f2b0f52a243e4737c129240475d.tar.gz
linux-stable-d20dcd2f11357f2b0f52a243e4737c129240475d.tar.bz2
linux-stable-d20dcd2f11357f2b0f52a243e4737c129240475d.zip
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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c
index 9c9a22958717..a8d2eb0ceb8d 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;