[PATCH] usb: asix: Fix uninit-value in asix_mdio_write

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The local variables use without initilization value.
This fixes the syzbot report.

Reported-by: syzbot+7dc7c28d4577bbe55b10@xxxxxxxxxxxxxxxxxxxxxxxxx

Test result:

https://groups.google.com/d/msg/syzkaller-bugs/3H_n05x_sPU/sUoHhxgAAgAJ

Signed-off-by: Phong Tran <tranmanphong@xxxxxxxxx>
---
 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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux