mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 23:58:05 +00:00
staging: vt6656: vnt_usb_send_context remove variable data.
A limit is also placed in vnt_tx_context of MAX_TOTAL_SIZE_WITH_ALL_HEADERS limiting size. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Link: https://lore.kernel.org/r/9416e1a8-bd72-ffb1-5366-78361d053907@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9deca1e3e2
commit
9786f8b2f7
3 changed files with 5 additions and 4 deletions
|
@ -250,7 +250,6 @@ struct vnt_usb_send_context {
|
||||||
u8 pkt_type;
|
u8 pkt_type;
|
||||||
u8 need_ack;
|
u8 need_ack;
|
||||||
bool in_use;
|
bool in_use;
|
||||||
unsigned char data[MAX_TOTAL_SIZE_WITH_ALL_HEADERS];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -73,9 +73,6 @@ static struct vnt_usb_send_context
|
||||||
context = priv->tx_context[ii];
|
context = priv->tx_context[ii];
|
||||||
if (!context->in_use) {
|
if (!context->in_use) {
|
||||||
context->in_use = true;
|
context->in_use = true;
|
||||||
memset(context->data, 0,
|
|
||||||
MAX_TOTAL_SIZE_WITH_ALL_HEADERS);
|
|
||||||
|
|
||||||
context->hdr = NULL;
|
context->hdr = NULL;
|
||||||
|
|
||||||
return context;
|
return context;
|
||||||
|
|
|
@ -463,6 +463,11 @@ int vnt_tx_context(struct vnt_private *priv,
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (context->buf_len > MAX_TOTAL_SIZE_WITH_ALL_HEADERS) {
|
||||||
|
context->in_use = false;
|
||||||
|
return -E2BIG;
|
||||||
|
}
|
||||||
|
|
||||||
usb_fill_bulk_urb(urb,
|
usb_fill_bulk_urb(urb,
|
||||||
priv->usb,
|
priv->usb,
|
||||||
usb_sndbulkpipe(priv->usb, 3),
|
usb_sndbulkpipe(priv->usb, 3),
|
||||||
|
|
Loading…
Reference in a new issue