From 067f8727a69f1d7dac4adfd65bb56433d18e0af4 Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Wed, 26 Jul 2017 11:27:01 +0100 Subject: [PATCH] Apply https://github.com/torvalds/linux/commit/b00ce11f00c9e86442de000e8bd3dd42f089c8e1 --- brick/kernel/f_mass_storage.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/brick/kernel/f_mass_storage.c b/brick/kernel/f_mass_storage.c index 6e48802d..fb67d296 100644 --- a/brick/kernel/f_mass_storage.c +++ b/brick/kernel/f_mass_storage.c @@ -614,7 +614,12 @@ static int fsg_setup(struct usb_function *f, return -EDOM; VDBG(fsg, "get max LUN\n"); *(u8 *) req->buf = fsg->common->nluns - 1; - return 1; + + /* Respond with data/status */ + req->length = min(1, w_length); + fsg->common->ep0req_name = + ctrl->bRequestType & USB_DIR_IN ? "ep0-in" : "ep0-out"; + return ep0_queue(fsg->common); } VDBG(fsg, @@ -2534,14 +2539,6 @@ static void handle_exception(struct fsg_common *common) case FSG_STATE_CONFIG_CHANGE: rc = do_set_config(common, new_config); - if (common->ep0_req_tag != exception_req_tag) - break; - if (rc != 0) { /* STALL on errors */ - DBG(common, "ep0 set halt\n"); - usb_ep_set_halt(common->ep0); - } else { /* Complete the status stage */ - ep0_queue(common); - } break; case FSG_STATE_EXIT: