On Thu, 12 May 2011 22:17:10 +0100, Chris Wilson <[email protected]> wrote:
> + pages = kmalloc(n*sizeof(struct page *),
> + GFP_KERNEL | __GFP_NORETRY | __GFP_NOWARN);
> + if (pages == NULL) {
> + pages = drm_malloc_ab(n, sizeof(struct page *));
> + if (pages == NULL) {
> + *pages_out = NULL;
> + *num_pages = 0;
> + return -ENOMEM;
> + }
> + }
Please use drm_malloc_ab here unconditionally; you've got a potential
multiplication overflow, and drm_malloc_ab already uses kmalloc for
small amounts anyways.
Otherwise, this looks good to me.
--
[email protected]
pgpTToZHp28Kg.pgp
Description: PGP signature
_______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
