Commit cf3770e
io_uring: Fix premature return from loop and memory leak
Currently the -EINVAL error return path is leaking memory allocated
to data. Fix this by not returning immediately but instead setting
the error return variable to -EINVAL and breaking out of the loop.
Kudos to Pavel Begunkov for suggesting a correct fix.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/20210429104602.62676-1-colin.king@canonical.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 47b228c commit cf3770e
1 file changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8417 | 8417 | | |
8418 | 8418 | | |
8419 | 8419 | | |
8420 | | - | |
8421 | | - | |
| 8420 | + | |
| 8421 | + | |
| 8422 | + | |
| 8423 | + | |
8422 | 8424 | | |
8423 | 8425 | | |
8424 | 8426 | | |
| |||
8468 | 8470 | | |
8469 | 8471 | | |
8470 | 8472 | | |
8471 | | - | |
8472 | | - | |
| 8473 | + | |
| 8474 | + | |
| 8475 | + | |
| 8476 | + | |
8473 | 8477 | | |
8474 | 8478 | | |
8475 | 8479 | | |
| |||
0 commit comments