]>
Commit | Line | Data |
---|---|---|
638585f7 GKH |
1 | From a67fedd788182764dc8ed59037c604b7e60349f1 Mon Sep 17 00:00:00 2001 |
2 | From: Tim Collier <osdevtc@gmail.com> | |
3 | Date: Sat, 11 May 2019 18:40:46 +0100 | |
4 | Subject: staging: wlan-ng: fix adapter initialization failure | |
5 | ||
6 | From: Tim Collier <osdevtc@gmail.com> | |
7 | ||
8 | commit a67fedd788182764dc8ed59037c604b7e60349f1 upstream. | |
9 | ||
10 | Commit e895f00a8496 ("Staging: wlan-ng: hfa384x_usb.c Fixed too long | |
11 | code line warnings.") moved the retrieval of the transfer buffer from | |
12 | the URB from the top of function hfa384x_usbin_callback to a point | |
13 | after reposting of the URB via a call to submit_rx_urb. The reposting | |
14 | of the URB allocates a new transfer buffer so the new buffer is | |
15 | retrieved instead of the buffer containing the response passed into | |
16 | the callback. This results in failure to initialize the adapter with | |
17 | an error reported in the system log (something like "CTLX[1] error: | |
18 | state(Request failed)"). | |
19 | ||
20 | This change moves the retrieval to just before the point where the URB | |
21 | is reposted so that the correct transfer buffer is retrieved and | |
22 | initialization of the device succeeds. | |
23 | ||
24 | Signed-off-by: Tim Collier <osdevtc@gmail.com> | |
25 | Fixes: e895f00a8496 ("Staging: wlan-ng: hfa384x_usb.c Fixed too long code line warnings.") | |
26 | Cc: stable <stable@vger.kernel.org> | |
27 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
28 | ||
29 | --- | |
30 | drivers/staging/wlan-ng/hfa384x_usb.c | 3 ++- | |
31 | 1 file changed, 2 insertions(+), 1 deletion(-) | |
32 | ||
33 | --- a/drivers/staging/wlan-ng/hfa384x_usb.c | |
34 | +++ b/drivers/staging/wlan-ng/hfa384x_usb.c | |
35 | @@ -3119,7 +3119,9 @@ static void hfa384x_usbin_callback(struc | |
36 | break; | |
37 | } | |
38 | ||
39 | + /* Save values from the RX URB before reposting overwrites it. */ | |
40 | urb_status = urb->status; | |
41 | + usbin = (union hfa384x_usbin *)urb->transfer_buffer; | |
42 | ||
43 | if (action != ABORT) { | |
44 | /* Repost the RX URB */ | |
45 | @@ -3136,7 +3138,6 @@ static void hfa384x_usbin_callback(struc | |
46 | /* Note: the check of the sw_support field, the type field doesn't | |
47 | * have bit 12 set like the docs suggest. | |
48 | */ | |
49 | - usbin = (union hfa384x_usbin *)urb->transfer_buffer; | |
50 | type = le16_to_cpu(usbin->type); | |
51 | if (HFA384x_USB_ISRXFRM(type)) { | |
52 | if (action == HANDLE) { |