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

Commit 5f7cf7bf 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_cdev: Fix NULL pointer dereference in cser_free_inst"

parents 53459303 b6befe64
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
/*
 * Copyright (c) 2011, 2013-2016, The Linux Foundation. All rights reserved.
 * Copyright (c) 2011, 2013-2017, The Linux Foundation. All rights reserved.
 * Linux Foundation chooses to take subject only to the GPLv2 license terms,
 * and distributes only under these terms.
 *
@@ -826,8 +826,10 @@ static void cser_free_inst(struct usb_function_instance *fi)

	opts = container_of(fi, struct f_cdev_opts, func_inst);

	if (opts->port) {
		device_destroy(fcdev_classp, MKDEV(major, opts->port->minor));
		cdev_del(&opts->port->fcdev_cdev);
	}
	usb_cser_chardev_deinit();
	kfree(opts->func_name);
	kfree(opts->port);