mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 11:06:41 -05:00
fbdev: xenfb: Use vmalloc_array to simplify code
Use vmalloc_array() instead of vmalloc() to simplify the function xenfb_probe(). Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com> Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
committed by
Helge Deller
parent
e5f0a698b3
commit
d391bb1955
@@ -390,7 +390,7 @@ static int xenfb_probe(struct xenbus_device *dev,
|
||||
|
||||
info->nr_pages = (fb_size + PAGE_SIZE - 1) >> PAGE_SHIFT;
|
||||
|
||||
info->gfns = vmalloc(array_size(sizeof(unsigned long), info->nr_pages));
|
||||
info->gfns = vmalloc_array(info->nr_pages, sizeof(unsigned long));
|
||||
if (!info->gfns)
|
||||
goto error_nomem;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user