Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 221823
b: refs/heads/master
c: f3f63c1
h: refs/heads/master
i:
  221821: ab3f689
  221819: 9664ab4
  221815: 4ef765b
  221807: 46e2819
  221791: 1a9b7a5
  221759: 61fd92e
  221695: b5656fa
v: v3
  • Loading branch information
Jens Axboe committed Nov 10, 2010
1 parent 2e5b1fc commit de404f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9f864c80913467312c7b8690e41fb5ebd1b50e92
refs/heads/master: f3f63c1c28bc861a931fac283b5bc3585efb8967
9 changes: 8 additions & 1 deletion trunk/fs/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ struct bio *bio_kmalloc(gfp_t gfp_mask, int nr_iovecs)
{
struct bio *bio;

if (nr_iovecs > UIO_MAXIOV)
return NULL;

bio = kmalloc(sizeof(struct bio) + nr_iovecs * sizeof(struct bio_vec),
gfp_mask);
if (unlikely(!bio))
Expand Down Expand Up @@ -697,8 +700,12 @@ static void bio_free_map_data(struct bio_map_data *bmd)
static struct bio_map_data *bio_alloc_map_data(int nr_segs, int iov_count,
gfp_t gfp_mask)
{
struct bio_map_data *bmd = kmalloc(sizeof(*bmd), gfp_mask);
struct bio_map_data *bmd;

if (iov_count > UIO_MAXIOV)
return NULL;

bmd = kmalloc(sizeof(*bmd), gfp_mask);
if (!bmd)
return NULL;

Expand Down

0 comments on commit de404f0

Please sign in to comment.