diff options
| -rw-r--r-- | drivers/net/wireless/rndis_wlan.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index 454f2f182342..ce138d846193 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
| @@ -3043,7 +3043,7 @@ static void rndis_wlan_media_specific_indication(struct usbnet *usbdev, | |||
| 3043 | struct rndis_indicate *msg, int buflen) | 3043 | struct rndis_indicate *msg, int buflen) |
| 3044 | { | 3044 | { |
| 3045 | struct ndis_80211_status_indication *indication; | 3045 | struct ndis_80211_status_indication *indication; |
| 3046 | int len, offset; | 3046 | unsigned int len, offset; |
| 3047 | 3047 | ||
| 3048 | offset = offsetof(struct rndis_indicate, status) + | 3048 | offset = offsetof(struct rndis_indicate, status) + |
| 3049 | le32_to_cpu(msg->offset); | 3049 | le32_to_cpu(msg->offset); |
| @@ -3055,7 +3055,7 @@ static void rndis_wlan_media_specific_indication(struct usbnet *usbdev, | |||
| 3055 | return; | 3055 | return; |
| 3056 | } | 3056 | } |
| 3057 | 3057 | ||
| 3058 | if (offset + len > buflen) { | 3058 | if (len > buflen || offset > buflen || offset + len > buflen) { |
| 3059 | netdev_info(usbdev->net, "media specific indication, too large to fit to buffer (%i > %i)\n", | 3059 | netdev_info(usbdev->net, "media specific indication, too large to fit to buffer (%i > %i)\n", |
| 3060 | offset + len, buflen); | 3060 | offset + len, buflen); |
| 3061 | return; | 3061 | return; |
