Commit 3fd14ebc authored by Quentin Deslandes's avatar Quentin Deslandes Committed by Greg Kroah-Hartman

staging: vt6656: fix potential NULL pointer dereference

vnt_free_tx_bufs() relies on priv->tx_context elements to be NULL if
they are not initialized (as vnt_free_rx_bufs() does). Add a check to
these elements in order to avoid NULL pointer dereference.
Signed-off-by: default avatarQuentin Deslandes <quentin.deslandes@itdev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a7bfc177
...@@ -363,6 +363,9 @@ static void vnt_free_tx_bufs(struct vnt_private *priv) ...@@ -363,6 +363,9 @@ static void vnt_free_tx_bufs(struct vnt_private *priv)
for (ii = 0; ii < priv->num_tx_context; ii++) { for (ii = 0; ii < priv->num_tx_context; ii++) {
tx_context = priv->tx_context[ii]; tx_context = priv->tx_context[ii];
if (!tx_context)
continue;
/* deallocate URBs */ /* deallocate URBs */
if (tx_context->urb) { if (tx_context->urb) {
usb_kill_urb(tx_context->urb); usb_kill_urb(tx_context->urb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment