Skip to content

Commit fb8ed3a

Browse files
Jan Dakinevichdavem330
authored andcommitted
cnic: use kvzalloc to allocate memory for csk_tbl
Size of csk_tbl is about 58K, which means 3rd order page allocation. kvzalloc provides a fallback if no high order memory is available. Signed-off-by: Jan Dakinevich <jan.dakinevich@virtuozzo.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 3c54672 commit fb8ed3a

File tree

1 file changed

+3
-3
lines changed
  • drivers/net/ethernet/broadcom

1 file changed

+3
-3
lines changed

drivers/net/ethernet/broadcom/cnic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4088,7 +4088,7 @@ static void cnic_cm_free_mem(struct cnic_dev *dev)
40884088
{
40894089
struct cnic_local *cp = dev->cnic_priv;
40904090

4091-
kfree(cp->csk_tbl);
4091+
kvfree(cp->csk_tbl);
40924092
cp->csk_tbl = NULL;
40934093
cnic_free_id_tbl(&cp->csk_port_tbl);
40944094
}
@@ -4098,8 +4098,8 @@ static int cnic_cm_alloc_mem(struct cnic_dev *dev)
40984098
struct cnic_local *cp = dev->cnic_priv;
40994099
u32 port_id;
41004100

4101-
cp->csk_tbl = kcalloc(MAX_CM_SK_TBL_SZ, sizeof(struct cnic_sock),
4102-
GFP_KERNEL);
4101+
cp->csk_tbl = kvcalloc(MAX_CM_SK_TBL_SZ, sizeof(struct cnic_sock),
4102+
GFP_KERNEL);
41034103
if (!cp->csk_tbl)
41044104
return -ENOMEM;
41054105

0 commit comments

Comments
 (0)