Skip to content

Commit

Permalink
rt2x00usb: initialize the read value in case of failure
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  • Loading branch information
Sebastian Andrzej Siewior authored and Kalle Valo committed Mar 16, 2015
1 parent 6e9344f commit e4fcfaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/wireless/rt2x00/rt2x00usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down

0 comments on commit e4fcfaf

Please sign in to comment.