提交 3fd14ebc 编写于 作者: Q Quentin Deslandes 提交者: 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: NQuentin Deslandes <quentin.deslandes@itdev.co.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册