UPSTREAM: net: cdc_ether: fix divide by 0 on bad descriptors

Setting dev->hard_mtu to 0 will cause a divide error in
usbnet_probe. Protect against devices with bogus CDC Ethernet
functional descriptors by ignoring a zero wMaxSegmentSize.

TEST=Build and run

Change-Id: I0664ec88dff4d2a3ee1b134ce27000c35b4d617c
Signed-off-by: Bjrn Mork <>
Acked-by: Oliver Neukum <>
Signed-off-by: David S. Miller <>
Signed-off-by: Guenter Roeck <>
(cherry picked from commit 2cb80187ba06)
Reviewed-by: Daniel Wang <>
Reviewed-by: Kevin Cernekee <>
1 file changed