[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191107004404.23707-1-tranmanphong@gmail.com>
Date: Thu, 7 Nov 2019 07:44:04 +0700
From: Phong Tran <tranmanphong@...il.com>
To: syzbot+7dc7c28d4577bbe55b10@...kaller.appspotmail.com,
davem@...emloft.net, gregkh@...uxfoundation.org
Cc: glider@...gle.com, hslester96@...il.com,
kstewart@...uxfoundation.org, linux-kernel@...r.kernel.org,
linux-usb@...r.kernel.org, netdev@...r.kernel.org,
syzkaller-bugs@...glegroups.com, tglx@...utronix.de,
linux-kernel-mentees@...ts.linuxfoundation.org,
Phong Tran <tranmanphong@...il.com>
Subject: [PATCH] usb: asix: Fix uninit-value in asix_mdio_write
The local variables use without initilization value.
This fixes the syzbot report.
Reported-by: syzbot+7dc7c28d4577bbe55b10@...kaller.appspotmail.com
Test result:
https://groups.google.com/d/msg/syzkaller-bugs/3H_n05x_sPU/sUoHhxgAAgAJ
Signed-off-by: Phong Tran <tranmanphong@...il.com>
---
drivers/net/usb/asix_common.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/usb/asix_common.c b/drivers/net/usb/asix_common.c
index e39f41efda3e..3c7ccd8a9da8 100644
--- a/drivers/net/usb/asix_common.c
+++ b/drivers/net/usb/asix_common.c
@@ -444,8 +444,8 @@ void asix_set_multicast(struct net_device *net)
int asix_mdio_read(struct net_device *netdev, int phy_id, int loc)
{
struct usbnet *dev = netdev_priv(netdev);
- __le16 res;
- u8 smsr;
+ __le16 res = 0;
+ u8 smsr = 0;
int i = 0;
int ret;
@@ -478,7 +478,7 @@ void asix_mdio_write(struct net_device *netdev, int phy_id, int loc, int val)
{
struct usbnet *dev = netdev_priv(netdev);
__le16 res = cpu_to_le16(val);
- u8 smsr;
+ u8 smsr = 0;
int i = 0;
int ret;
@@ -508,8 +508,8 @@ void asix_mdio_write(struct net_device *netdev, int phy_id, int loc, int val)
int asix_mdio_read_nopm(struct net_device *netdev, int phy_id, int loc)
{
struct usbnet *dev = netdev_priv(netdev);
- __le16 res;
- u8 smsr;
+ __le16 res = 0;
+ u8 smsr = 0;
int i = 0;
int ret;
@@ -543,7 +543,7 @@ asix_mdio_write_nopm(struct net_device *netdev, int phy_id, int loc, int val)
{
struct usbnet *dev = netdev_priv(netdev);
__le16 res = cpu_to_le16(val);
- u8 smsr;
+ u8 smsr = 0;
int i = 0;
int ret;
--
2.20.1
Powered by blists - more mailing lists