Ian Abbott bb509a6ffe comedi: Fix memory leak in compat_insnlist()
`compat_insnlist()` handles the 32-bit version of the `COMEDI_INSNLIST`
ioctl (whenwhen `CONFIG_COMPAT` is enabled).  It allocates memory to
temporarily hold an array of `struct comedi_insn` converted from the
32-bit version in user space.  This memory is only being freed if there
is a fault while filling the array, otherwise it is leaked.

Add a call to `kfree()` to fix the leak.

Fixes: b8d47d881305 ("comedi: get rid of compat_alloc_user_space() mess in COMEDI_INSNLIST compat")
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev
Cc: <stable@vger.kernel.org> # 5.13+
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://lore.kernel.org/r/20210916145023.157479-1-abbotti@mev.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-21 17:53:54 +02:00
..
2021-09-10 13:29:04 -07:00
2021-09-01 08:44:42 -07:00
2021-09-11 14:48:42 -07:00
2021-09-01 15:25:28 -07:00
2021-09-07 12:38:59 -07:00
2021-09-07 19:13:42 -07:00
2021-09-09 11:48:27 -07:00
2021-09-09 11:39:57 -07:00
2021-09-08 11:50:26 -07:00
2021-09-09 11:07:47 -07:00
2021-09-07 12:27:27 -07:00
2021-09-10 11:22:23 -07:00
2021-09-01 18:25:20 -07:00
2021-09-02 13:49:39 -07:00
2021-09-11 14:48:42 -07:00
2021-09-01 09:51:16 -07:00
2021-09-03 15:33:47 -07:00
2021-09-03 15:33:47 -07:00
2021-09-09 11:39:57 -07:00
2021-09-01 08:44:42 -07:00
2021-09-07 12:38:59 -07:00
2021-09-07 19:13:42 -07:00
2021-09-09 11:48:27 -07:00
2021-09-08 16:33:21 -07:00
2021-09-03 15:33:47 -07:00
2021-09-08 16:43:46 -07:00
2021-08-26 12:06:42 +01:00
2021-09-01 15:25:28 -07:00
2021-09-09 10:18:40 +02:00
2021-09-07 19:13:42 -07:00
2021-09-01 08:44:42 -07:00
2021-09-01 15:25:28 -07:00
2021-09-01 10:29:29 -07:00
2021-09-01 15:25:28 -07:00
2021-09-03 15:33:47 -07:00
2021-09-02 15:09:46 -07:00
2021-09-05 11:19:15 -07:00
2021-09-11 14:48:42 -07:00
2021-09-02 13:41:33 -07:00
2021-09-11 14:48:42 -07:00
2021-09-10 11:22:23 -07:00
2021-09-11 14:48:42 -07:00
2021-09-03 15:33:47 -07:00