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

Commit 6f053e36 authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman
Browse files

cdc-acm: fix race between reset and control messaging



commit 9397940e upstream.

If a device splits up a control message and a reset() happens
between the parts, the message is lost and already recieved parts
must be dropped.

Signed-off-by: default avatarOliver Neukum <oneukum@suse.com>
Fixes: 1aba579f ("cdc-acm: handle read pipe errors")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 32772ef3
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1654,6 +1654,7 @@ static int acm_pre_reset(struct usb_interface *intf)
	struct acm *acm = usb_get_intfdata(intf);
	struct acm *acm = usb_get_intfdata(intf);


	clear_bit(EVENT_RX_STALL, &acm->flags);
	clear_bit(EVENT_RX_STALL, &acm->flags);
	acm->nb_index = 0; /* pending control transfers are lost */


	return 0;
	return 0;
}
}