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

Commit f747a075 authored by Manu Gautam's avatar Manu Gautam
Browse files

USB: gadget: qdss: Flush pending works before function unbind



Workqueue might have pending connect/disconnect works when
composite driver calls qdss unbind as part of composition
switch or remove. As qdss_unbind frees up device references
e.g. ep->driver_data, flush pending works from unbind to avoid
any access to them later from work_fn.

Change-Id: I2ea3988ccebb6fc34772b30965ab8a1cb74d5464
Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
parent 077dfa98
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
/*
 * f_qdss.c -- QDSS function Driver
 *
 * 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 and
@@ -415,6 +415,8 @@ static void qdss_unbind(struct usb_configuration *c, struct usb_function *f)

	pr_debug("qdss_unbind\n");

	flush_workqueue(qdss->wq);

	if (gadget_is_dwc3(gadget))
		dwc3_tx_fifo_resize_request(qdss->data, false);