diff options
author | Quentin Deslandes <quentin.deslandes@itdev.co.uk> | 2019-05-20 19:39:01 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-21 09:25:03 +0300 |
commit | 3fd14ebc2d5233e0fd6a90486cb88f5592875a6b (patch) | |
tree | 6b88341e24e134bc126bcf4f2989f57a0d14b874 /drivers/staging/vt6656 | |
parent | a7bfc177d8a5865f4c14043d98a24b1e962289c5 (diff) | |
download | linux-3fd14ebc2d5233e0fd6a90486cb88f5592875a6b.tar.xz |
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: Quentin Deslandes <quentin.deslandes@itdev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6656')
-rw-r--r-- | drivers/staging/vt6656/main_usb.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c index ccafcc2c87ac..bfe952fe27bf 100644 --- a/drivers/staging/vt6656/main_usb.c +++ b/drivers/staging/vt6656/main_usb.c @@ -363,6 +363,9 @@ static void vnt_free_tx_bufs(struct vnt_private *priv) for (ii = 0; ii < priv->num_tx_context; ii++) { tx_context = priv->tx_context[ii]; + if (!tx_context) + continue; + /* deallocate URBs */ if (tx_context->urb) { usb_kill_urb(tx_context->urb); |