mt76: usb: do not build the skb if reported len does not fit in buf_size
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Sat, 1 Dec 2018 14:01:19 +0000 (15:01 +0100)
committerFelix Fietkau <nbd@nbd.name>
Fri, 11 Jan 2019 14:10:15 +0000 (15:10 +0100)
commit0ecf94dc3695a494dd4f495fc0913049d0e99891
treedfe5aa8fffd1d60bab520a2c5a22518f4a502cd3
parent4d4b12bc56d33d68ad04382f4c15c42bf4616270
mt76: usb: do not build the skb if reported len does not fit in buf_size

Precompute data length in order to avoid to allocate the related
skb data structure if reported length does not fit in queue buf_size

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/usb.c