Re: [PATCH] ALSA: Remove subsystem-specific malloc (1/8)

Chris Wright
2004-06-09T21:02:06Z

* Pekka Enberg (penberg@cs.helsinki.fi) wrote:
> +void *kcalloc(size_t n, size_t size, int flags)
> +{
> + if (n != 0 && size > INT_MAX / n)
> + return NULL;

Yup, I forgot to add divide by zero check.

> + void *ret = kmalloc(n * size, flags);

This is only C99, and will make some compilers spit up warning.

thanks,
-chris
--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net