[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190814022323.17111-16-sashal@kernel.org>
Date: Tue, 13 Aug 2019 22:23:06 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Denis Kirjanov <kda@...ux-powerpc.org>,
syzbot+3499a83b2d062ae409d4@...kaller.appspotmail.com,
"David S . Miller" <davem@...emloft.net>,
Sasha Levin <sashal@...nel.org>, linux-usb@...r.kernel.org,
netdev@...r.kernel.org
Subject: [PATCH AUTOSEL 4.9 16/33] net: usb: pegasus: fix improper read if get_registers() fail
From: Denis Kirjanov <kda@...ux-powerpc.org>
[ Upstream commit 224c04973db1125fcebefffd86115f99f50f8277 ]
get_registers() may fail with -ENOMEM and in this
case we can read a garbage from the status variable tmp.
Reported-by: syzbot+3499a83b2d062ae409d4@...kaller.appspotmail.com
Signed-off-by: Denis Kirjanov <kda@...ux-powerpc.org>
Signed-off-by: David S. Miller <davem@...emloft.net>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/net/usb/pegasus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
index ee40ac23507a0..5fe9f1273fe20 100644
--- a/drivers/net/usb/pegasus.c
+++ b/drivers/net/usb/pegasus.c
@@ -285,7 +285,7 @@ static void mdio_write(struct net_device *dev, int phy_id, int loc, int val)
static int read_eprom_word(pegasus_t *pegasus, __u8 index, __u16 *retdata)
{
int i;
- __u8 tmp;
+ __u8 tmp = 0;
__le16 retdatai;
int ret;
--
2.20.1
Powered by blists - more mailing lists