diff --git a/drivers/moto_f_mass_storage/f_mass_storage.c b/drivers/moto_f_mass_storage/f_mass_storage.c index d18543b88ac7..f82fa92eb1cf 100644 --- a/drivers/moto_f_mass_storage/f_mass_storage.c +++ b/drivers/moto_f_mass_storage/f_mass_storage.c @@ -1738,6 +1738,16 @@ static void fsg_disable(struct usb_function *f) { struct fsg_dev *fsg = fsg_from_func(f); + /* Disable the endpoints */ + if (fsg->bulk_in_enabled) { + usb_ep_disable(fsg->bulk_in); + fsg->bulk_in_enabled = 0; + } + if (fsg->bulk_out_enabled) { + usb_ep_disable(fsg->bulk_out); + fsg->bulk_out_enabled = 0; + } + __raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE, NULL); }