[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <x49r5whu99q.fsf@segfault.boston.devel.redhat.com>
Date: Wed, 15 Jul 2009 13:49:05 -0400
From: Jeff Moyer <jmoyer@...hat.com>
To: Roel Kluin <roel.kluin@...il.com>
Cc: jens.axboe@...cle.com, LKML <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] bio: sizeof pointer instead of size of the pointed-to type?
Roel Kluin <roel.kluin@...il.com> writes:
> Do not take the size of a pointer to determine the size of the pointed-to type
>
> Signed-off-by: Roel Kluin <roel.kluin@...il.com>
> ---
> This is not yet tested. Is it correct?
>
> diff --git a/fs/bio.c b/fs/bio.c
> index 7673800..e65c35d 100644
> --- a/fs/bio.c
> +++ b/fs/bio.c
> @@ -96,7 +96,7 @@ static struct kmem_cache *bio_find_or_create_slab(unsigned int extra_size)
> if (bio_slab_nr == bio_slab_max && entry == -1) {
> bio_slab_max <<= 1;
> bio_slabs = krealloc(bio_slabs,
> - bio_slab_max * sizeof(struct bio_slab),
> + bio_slab_max * sizeof(struct bio_slab *),
> GFP_KERNEL);
> if (!bio_slabs)
> goto out_unlock;
NAK. The code is correct as-is.
Cheers,
Jeff
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists