]> git.baikalelectronics.ru Git - kernel.git/commit
block: do not leak memory in bio_copy_user_iov()
authorJérôme Glisse <jglisse@redhat.com>
Wed, 10 Apr 2019 20:27:51 +0000 (16:27 -0400)
committerJens Axboe <axboe@kernel.dk>
Wed, 10 Apr 2019 22:14:40 +0000 (16:14 -0600)
commit82b0e5258964293a0c472853d7a0e77202946929
treea4308f3aae5a90ea3927becb776ff41acffe0163
parentb9d82f9b32e9f2d6e2221ca94f7213d2f44774cd
block: do not leak memory in bio_copy_user_iov()

When bio_add_pc_page() fails in bio_copy_user_iov() we should free
the page we just allocated otherwise we are leaking it.

Cc: linux-block@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: stable@vger.kernel.org
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c