]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.19/staging-wlan-ng-fix-adapter-initialization-failure.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.19 / staging-wlan-ng-fix-adapter-initialization-failure.patch
CommitLineData
638585f7
GKH
1From a67fedd788182764dc8ed59037c604b7e60349f1 Mon Sep 17 00:00:00 2001
2From: Tim Collier <osdevtc@gmail.com>
3Date: Sat, 11 May 2019 18:40:46 +0100
4Subject: staging: wlan-ng: fix adapter initialization failure
5
6From: Tim Collier <osdevtc@gmail.com>
7
8commit a67fedd788182764dc8ed59037c604b7e60349f1 upstream.
9
10Commit e895f00a8496 ("Staging: wlan-ng: hfa384x_usb.c Fixed too long
11code line warnings.") moved the retrieval of the transfer buffer from
12the URB from the top of function hfa384x_usbin_callback to a point
13after reposting of the URB via a call to submit_rx_urb. The reposting
14of the URB allocates a new transfer buffer so the new buffer is
15retrieved instead of the buffer containing the response passed into
16the callback. This results in failure to initialize the adapter with
17an error reported in the system log (something like "CTLX[1] error:
18state(Request failed)").
19
20This change moves the retrieval to just before the point where the URB
21is reposted so that the correct transfer buffer is retrieved and
22initialization of the device succeeds.
23
24Signed-off-by: Tim Collier <osdevtc@gmail.com>
25Fixes: e895f00a8496 ("Staging: wlan-ng: hfa384x_usb.c Fixed too long code line warnings.")
26Cc: stable <stable@vger.kernel.org>
27Signed-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) {