Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00e993dd authored by Dov Levenglick's avatar Dov Levenglick
Browse files

usb: f_qc_rndis: set context for encapsulated response



Setting the req->context field for encapsulated responses
as well as for encapsulated commands. This prevents a
corner case where the request is initially used for
a response, prior to using it for a command.

Change-Id: I466bf9c02669161df3565d3f6f9a064aabffa822
Signed-off-by: default avatarDov Levenglick <dovl@codeaurora.org>
parent a260c9b2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
 * Copyright (C) 2008 Nokia Corporation
 * Copyright (C) 2009 Samsung Electronics
 *			Author: Michal Nazarewicz (mina86@mina86.com)
 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2
@@ -633,7 +633,6 @@ rndis_qc_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
		/* read the request; process it later */
		value = w_length;
		req->complete = rndis_qc_command_complete;
		req->context = rndis;
		/* later, rndis_response_available() sends a notification */
		break;

@@ -669,6 +668,7 @@ invalid:
		DBG(cdev, "rndis req%02x.%02x v%04x i%04x l%d\n",
			ctrl->bRequestType, ctrl->bRequest,
			w_value, w_index, w_length);
		req->context = rndis;
		req->zero = (value < w_length);
		req->length = value;
		value = usb_ep_queue(cdev->gadget->ep0, req, GFP_ATOMIC);