Commit 1e51f935 authored by Wang Hai's avatar Wang Hai Committed by David S. Miller

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: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarWang Hai <wanghai38@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a0d716d8
...@@ -1056,7 +1056,7 @@ void octeon_delete_dispatch_list(struct octeon_device *oct) ...@@ -1056,7 +1056,7 @@ void octeon_delete_dispatch_list(struct octeon_device *oct)
list_for_each_safe(temp, tmp2, &freelist) { list_for_each_safe(temp, tmp2, &freelist) {
list_del(temp); list_del(temp);
vfree(temp); kfree(temp);
} }
} }
...@@ -1152,13 +1152,10 @@ octeon_register_dispatch_fn(struct octeon_device *oct, ...@@ -1152,13 +1152,10 @@ octeon_register_dispatch_fn(struct octeon_device *oct,
dev_dbg(&oct->pci_dev->dev, dev_dbg(&oct->pci_dev->dev,
"Adding opcode to dispatch list linked list\n"); "Adding opcode to dispatch list linked list\n");
dispatch = (struct octeon_dispatch *) dispatch = kmalloc(sizeof(*dispatch), GFP_KERNEL);
vmalloc(sizeof(struct octeon_dispatch)); if (!dispatch)
if (!dispatch) {
dev_err(&oct->pci_dev->dev,
"No memory to add dispatch function\n");
return 1; return 1;
}
dispatch->opcode = combined_opcode; dispatch->opcode = combined_opcode;
dispatch->dispatch_fn = fn; dispatch->dispatch_fn = fn;
dispatch->arg = fn_arg; dispatch->arg = fn_arg;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment