Commit 56d08216 authored by Jens Axboe's avatar Jens Axboe Committed by Linus Torvalds

[PATCH] thinko in kmalloc check in partial completion fix

Silly thinko/typo, it needs to check the newly allocated memory for
failure of course. Noticed by Stefan Meyknecht.
Signed-off-by: default avatarJens Axboe <axboe@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent feaaa64a
...@@ -397,7 +397,7 @@ static struct bio_map_data *bio_alloc_map_data(int nr_segs) ...@@ -397,7 +397,7 @@ static struct bio_map_data *bio_alloc_map_data(int nr_segs)
return NULL; return NULL;
bmd->iovecs = kmalloc(sizeof(struct bio_vec) * nr_segs, GFP_KERNEL); bmd->iovecs = kmalloc(sizeof(struct bio_vec) * nr_segs, GFP_KERNEL);
if (bmd) if (bmd->iovecs)
return bmd; return bmd;
kfree(bmd); kfree(bmd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment