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

Commit fa2c72a8 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: f_qdss: Remove channel from list in free_inst"

parents bd7e6741 7bdadf4f
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
/*
 * f_qdss.c -- QDSS function Driver
 *
 * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2018, 2020, 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
@@ -1129,8 +1129,21 @@ static struct config_item_type qdss_func_type = {
static void usb_qdss_free_inst(struct usb_function_instance *fi)
{
	struct usb_qdss_opts *opts;
	struct usb_qdss_ch *ch;
	unsigned long flags;

	opts = container_of(fi, struct usb_qdss_opts, func_inst);
	spin_lock_irqsave(&qdss_lock, flags);
	list_for_each_entry(ch, &usb_qdss_ch_list, list) {
		if (!strcmp(opts->channel_name, ch->name)) {
			list_del(&ch->list);
			break;
		}
	}

	spin_unlock_irqrestore(&qdss_lock, flags);
	kfree(opts->channel_name);
	destroy_workqueue(opts->usb_qdss->wq);
	kfree(opts->usb_qdss);
	kfree(opts);
}