summaryrefslogtreecommitdiff
path: root/drivers/staging/erofs/data.c
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2019-04-15 12:52:30 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-16 13:05:33 +0200
commit663d294b4768bfd89e529e069bffa544a830b5bf (patch)
tree0177025e73a29ffec94171d8a0517b24f49ab9d0 /drivers/staging/erofs/data.c
parent08b7c2f9208f0e2a32159e4e7a4831b7adb10a3e (diff)
staging: comedi: vmk80xx: Fix possible double-free of ->usb_rx_buf
`vmk80xx_alloc_usb_buffers()` is called from `vmk80xx_auto_attach()` to allocate RX and TX buffers for USB transfers. It allocates `devpriv->usb_rx_buf` followed by `devpriv->usb_tx_buf`. If the allocation of `devpriv->usb_tx_buf` fails, it frees `devpriv->usb_rx_buf`, leaving the pointer set dangling, and returns an error. Later, `vmk80xx_detach()` will be called from the core comedi module code to clean up. `vmk80xx_detach()` also frees both `devpriv->usb_rx_buf` and `devpriv->usb_tx_buf`, but `devpriv->usb_rx_buf` may have already been freed, leading to a double-free error. Fix it by removing the call to `kfree(devpriv->usb_rx_buf)` from `vmk80xx_alloc_usb_buffers()`, relying on `vmk80xx_detach()` to free the memory. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/erofs/data.c')
0 files changed, 0 insertions, 0 deletions