usb: gadget: u_ether: Fix MTU size mismatch with RX packet size
authorManish Narani <manish.narani@xilinx.com>
Tue, 17 Nov 2020 07:13:35 +0000 (12:43 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Feb 2021 13:00:34 +0000 (14:00 +0100)
commit2afb9a5a42ab910589d3a3da96d365cb7085ff8b
treee64ffc7a17f20b2d36819bac3349f32a980145b9
parent2c7a2cf336a2fb94e6c78b9ae4331581a311d01f
usb: gadget: u_ether: Fix MTU size mismatch with RX packet size

commit 0a88fa221ce911c331bf700d2214c5b2f77414d3 upstream

Fix the MTU size issue with RX packet size as the host sends the packet
with extra bytes containing ethernet header. This causes failure when
user sets the MTU size to the maximum i.e. 15412. In this case the
ethernet packet received will be of length 15412 plus the ethernet header
length. This patch fixes the issue where there is a check that RX packet
length must not be more than max packet length.

Fixes: bba787a860fa ("usb: gadget: ether: Allow jumbo frames")
Signed-off-by: Manish Narani <manish.narani@xilinx.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/1605597215-122027-1-git-send-email-manish.narani@xilinx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/u_ether.c