liquidio: Replace vmalloc with kmalloc in octeon_register_dispatch_fn()
The size of struct octeon_dispatch is too small, it is better to use kmalloc instead of vmalloc. Suggested-by: Joe Perches <joe@perches.com> Signed-off-by: Wang Hai <wanghai38@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a0d716d8e4
commit
1e51f9358a
|
@ -1056,7 +1056,7 @@ void octeon_delete_dispatch_list(struct octeon_device *oct)
|
|||
|
||||
list_for_each_safe(temp, tmp2, &freelist) {
|
||||
list_del(temp);
|
||||
vfree(temp);
|
||||
kfree(temp);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1152,13 +1152,10 @@ octeon_register_dispatch_fn(struct octeon_device *oct,
|
|||
|
||||
dev_dbg(&oct->pci_dev->dev,
|
||||
"Adding opcode to dispatch list linked list\n");
|
||||
dispatch = (struct octeon_dispatch *)
|
||||
vmalloc(sizeof(struct octeon_dispatch));
|
||||
if (!dispatch) {
|
||||
dev_err(&oct->pci_dev->dev,
|
||||
"No memory to add dispatch function\n");
|
||||
dispatch = kmalloc(sizeof(*dispatch), GFP_KERNEL);
|
||||
if (!dispatch)
|
||||
return 1;
|
||||
}
|
||||
|
||||
dispatch->opcode = combined_opcode;
|
||||
dispatch->dispatch_fn = fn;
|
||||
dispatch->arg = fn_arg;
|
||||
|
|
Loading…
Reference in New Issue