Ian Abbott
0241c6f9f5
staging: comedi: ni_usb6501: Fix possible double-free of ->usb_rx_buf
...
commit af4b54a2e5 upstream.
`ni6501_alloc_usb_buffers()` is called from `ni6501_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, `ni6501_detach()` will be called from the core comedi
module code to clean up. `ni6501_detach()` also frees both
`devpriv->usb_rx_buf` and `devpriv->usb_tx_buf`, but
`devpriv->usb_rx_buf` may have already beed freed, leading to a
double-free error. Fix it bu removing the call to
`kfree(devpriv->usb_rx_buf)` from `ni6501_alloc_usb_buffers()`, relying
on `ni6501_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 >
2019-04-27 09:34:01 +02:00
..
2019-04-27 09:33:58 +02:00
2018-05-02 07:53:42 -07:00
2018-02-28 10:17:23 +01:00
2019-02-20 10:13:08 +01:00
2019-03-23 08:44:16 +01:00
2019-03-23 08:44:39 +01:00
2019-02-20 10:13:13 +01:00
2018-11-27 16:08:01 +01:00
2018-04-13 19:50:05 +02:00
2019-04-27 09:33:52 +02:00
2019-04-27 09:34:00 +02:00
2019-03-23 08:44:36 +01:00
2019-03-23 08:44:35 +01:00
2019-03-23 08:44:36 +01:00
2019-02-20 10:13:09 +01:00
2019-04-27 09:34:00 +02:00
2018-11-10 07:41:40 -08:00
2019-04-27 09:33:53 +02:00
2018-10-10 08:52:06 +02:00
2019-04-03 06:23:18 +02:00
2018-05-30 07:48:52 +02:00
2019-04-03 06:23:20 +02:00
2019-04-27 09:33:48 +02:00
2019-04-27 09:33:53 +02:00
2019-04-03 06:23:21 +02:00
2018-03-24 10:58:42 +01:00
2019-01-13 10:05:27 +01:00
2019-02-23 09:05:13 +01:00
2019-04-27 09:33:50 +02:00
2019-04-27 09:33:47 +02:00
2018-12-21 14:09:52 +01:00
2018-02-25 11:03:51 +01:00
2019-04-27 09:34:01 +02:00
2019-04-27 09:33:56 +02:00
2019-03-23 08:44:33 +01:00
2019-04-27 09:33:59 +02:00
2019-03-23 08:44:27 +01:00
2019-04-03 06:23:25 +02:00
2019-04-27 09:33:51 +02:00
2018-09-19 22:48:57 +02:00
2017-08-06 19:19:41 -07:00
2019-04-27 09:33:51 +02:00
2019-04-27 09:33:53 +02:00
2018-08-06 16:24:38 +02:00
2019-02-20 10:13:09 +01:00
2018-05-30 07:48:58 +02:00
2019-03-23 08:44:16 +01:00
2019-02-20 10:13:18 +01:00
2019-04-27 09:33:56 +02:00
2019-02-20 10:13:17 +01:00
2019-04-27 09:33:59 +02:00
2019-02-20 10:13:20 +01:00
2018-05-30 07:48:55 +02:00
2018-11-21 09:27:34 +01:00
2018-07-11 16:03:47 +02:00
2017-08-06 19:19:46 -07:00
2018-12-01 09:46:35 +01:00
2018-05-30 07:49:10 +02:00
2019-03-23 08:44:37 +01:00
2019-04-27 09:33:56 +02:00
2018-11-21 09:27:30 +01:00
2018-03-22 09:23:26 +01:00
2018-01-23 19:50:16 +01:00
2019-03-23 08:44:33 +01:00
2019-03-23 08:44:26 +01:00
2019-01-13 10:05:34 +01:00
2018-04-13 19:50:05 +02:00
2019-02-20 10:13:05 +01:00
2018-09-09 20:04:35 +02:00
2019-04-27 09:33:53 +02:00
2019-04-03 06:23:19 +02:00
2019-04-03 06:23:27 +02:00
2018-12-21 14:09:52 +01:00
2019-04-27 09:33:50 +02:00
2019-04-27 09:33:52 +02:00
2019-01-13 10:05:31 +01:00
2017-07-27 15:06:10 -07:00
2018-02-25 11:03:44 +01:00
2019-04-27 09:34:01 +02:00
2019-03-23 08:44:35 +01:00
2018-11-21 09:27:36 +01:00
2019-04-27 09:33:57 +02:00
2018-04-24 09:32:07 +02:00
2019-04-27 09:33:58 +02:00
2018-11-27 16:08:02 +01:00
2019-04-27 09:33:49 +02:00
2018-10-10 08:52:04 +02:00
2018-04-24 09:32:09 +02:00
2019-01-13 10:05:28 +01:00
2019-04-27 09:33:51 +02:00
2018-12-17 21:55:16 +01:00
2018-08-06 16:24:42 +02:00
2018-11-21 09:27:35 +01:00
2018-05-30 07:49:03 +02:00
2018-12-17 21:55:11 +01:00
2018-05-30 07:49:11 +02:00
2018-02-25 11:03:38 +01:00