Re: [PATCH] bio: sizeof pointer instead of size of the pointed-to type?

From: Jeff Moyer
Date: Wed Jul 15 2009 - 13:52:38 EST


Roel Kluin <roel.kluin@xxxxxxxxx> 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@xxxxxxxxx>
> ---
> 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/