|
@@ -923,8 +923,9 @@ int drm_legacy_addbufs_pci(struct drm_device *dev,
|
|
|
/* Keep the original pagelist until we know all the allocations
|
|
|
* have succeeded
|
|
|
*/
|
|
|
- temp_pagelist = kmalloc((dma->page_count + (count << page_order)) *
|
|
|
- sizeof(*dma->pagelist), GFP_KERNEL);
|
|
|
+ temp_pagelist = kmalloc_array(dma->page_count + (count << page_order),
|
|
|
+ sizeof(*dma->pagelist),
|
|
|
+ GFP_KERNEL);
|
|
|
if (!temp_pagelist) {
|
|
|
kfree(entry->buflist);
|
|
|
kfree(entry->seglist);
|