Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Minor overlapping changes in the btusb and ixgbe drivers. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -688,6 +688,9 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos
|
||||
if (!cdev->ap.applid)
|
||||
return -ENODEV;
|
||||
|
||||
if (count < CAPIMSG_BASELEN)
|
||||
return -EINVAL;
|
||||
|
||||
skb = alloc_skb(count, GFP_USER);
|
||||
if (!skb)
|
||||
return -ENOMEM;
|
||||
@@ -698,7 +701,8 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos
|
||||
}
|
||||
mlen = CAPIMSG_LEN(skb->data);
|
||||
if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_REQ) {
|
||||
if ((size_t)(mlen + CAPIMSG_DATALEN(skb->data)) != count) {
|
||||
if (count < CAPI_DATA_B3_REQ_LEN ||
|
||||
(size_t)(mlen + CAPIMSG_DATALEN(skb->data)) != count) {
|
||||
kfree_skb(skb);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -711,6 +715,10 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos
|
||||
CAPIMSG_SETAPPID(skb->data, cdev->ap.applid);
|
||||
|
||||
if (CAPIMSG_CMD(skb->data) == CAPI_DISCONNECT_B3_RESP) {
|
||||
if (count < CAPI_DISCONNECT_B3_RESP_LEN) {
|
||||
kfree_skb(skb);
|
||||
return -EINVAL;
|
||||
}
|
||||
mutex_lock(&cdev->lock);
|
||||
capincci_free(cdev, CAPIMSG_NCCI(skb->data));
|
||||
mutex_unlock(&cdev->lock);
|
||||
|
Reference in New Issue
Block a user