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

Commit c1a44345 authored by Jack Pham's avatar Jack Pham
Browse files

Revert "usb: gadget: f_mtp: Handle mtp os desc properly"



This reverts commit ac9d7c8b.
The fi->f pointer is getting assigned during function allocation
However, if MTP function is not added to the configuration, it
will still get control packets routed to its setup function
mtp_ctrlreq_configfs() and will dereference a NULL f->config.

Since fi->f is already correctly getting assigned during bind
and cleared during unbind, there is no need to assign it
during allocation.

Change-Id: Ic7c6a29796dd62774d36ad029cc0b854a42a8a4a
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 3afabc36
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -1893,7 +1893,6 @@ struct usb_function *function_alloc_mtp_ptp(struct usb_function_instance *fi,
	dev->function.disable = mtp_function_disable;
	dev->function.setup = mtp_ctrlreq_configfs;
	dev->function.free_func = mtp_free;
	fi->f = &dev->function;

	return &dev->function;
}