Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scatterlist: prevent invalid free when alloc fails
When alloc fails, free_table is being called. Depending on the number of bytes requested, we determine if we are going to call _get_free_page() or kmalloc(). When alloc fails, our math is wrong (due to sg_size - 1), and the last buffer is wrongfully assumed to have been allocated by kmalloc. Hence, kfree gets called and a panic occurs. Signed-off-by: Jeffrey Carlyle <[email protected]> Signed-off-by: Olusanya Soyannwo <[email protected]> Acked-by: Tejun Heo <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
- Loading branch information