linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] rt2x00usb: initialize the read value in case of failure
@ 2015-03-12 14:35 Sebastian Andrzej Siewior
  2015-03-12 14:35 ` [PATCH 2/3] rt2x00usb: check USB's request error code in rt2800usb_autorun_detect() Sebastian Andrzej Siewior
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Sebastian Andrzej Siewior @ 2015-03-12 14:35 UTC (permalink / raw)
  To: linux-wireless; +Cc: Stanislaw Gruszka, Helmut Schaa, Sebastian Andrzej Siewior

My understanding ist that rt2x00usb_register_read() is void and so the
reader is unaware of read errors and assumes that whatever was on the
stack as it was about to read.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/net/wireless/rt2x00/rt2x00usb.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.h b/drivers/net/wireless/rt2x00/rt2x00usb.h
index 8f85fbd5f237..569363da00a2 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.h
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.h
@@ -199,7 +199,7 @@ static inline void rt2x00usb_register_read(struct rt2x00_dev *rt2x00dev,
 					   const unsigned int offset,
 					   u32 *value)
 {
-	__le32 reg;
+	__le32 reg = 0;
 	rt2x00usb_vendor_request_buff(rt2x00dev, USB_MULTI_READ,
 				      USB_VENDOR_REQUEST_IN, offset,
 				      &reg, sizeof(reg));
@@ -219,7 +219,7 @@ static inline void rt2x00usb_register_read_lock(struct rt2x00_dev *rt2x00dev,
 						const unsigned int offset,
 						u32 *value)
 {
-	__le32 reg;
+	__le32 reg = 0;
 	rt2x00usb_vendor_req_buff_lock(rt2x00dev, USB_MULTI_READ,
 				       USB_VENDOR_REQUEST_IN, offset,
 				       &reg, sizeof(reg), REGISTER_TIMEOUT);
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-03-30  8:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-12 14:35 [PATCH 1/3] rt2x00usb: initialize the read value in case of failure Sebastian Andrzej Siewior
2015-03-12 14:35 ` [PATCH 2/3] rt2x00usb: check USB's request error code in rt2800usb_autorun_detect() Sebastian Andrzej Siewior
2015-03-12 14:35 ` [PATCH 3/3] rt2x00usb: drop rt2x00usb_disable_radio() from rt2800usb_disable_radio() Sebastian Andrzej Siewior
2015-03-16 16:06 ` [1/3] rt2x00usb: initialize the read value in case of failure Kalle Valo
2015-03-16 16:41   ` Sebastian Andrzej Siewior
2015-03-17  8:34     ` Sebastian Andrzej Siewior
2015-03-18 13:11       ` Stanislaw Gruszka
2015-03-19 13:24         ` Sebastian Andrzej Siewior
2015-03-19 14:30           ` Stanislaw Gruszka
2015-03-19 14:32           ` [PATCH] rt2800usb: check Autorun mode on FW load only once Stanislaw Gruszka
2015-03-30  8:29             ` Kalle Valo
2015-03-18 12:48     ` [1/3] rt2x00usb: initialize the read value in case of failure Stanislaw Gruszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).