提交 848850a3 编写于 作者: V Varsha Rao 提交者: Simon Horman

netfilter: ipvs: Replace kzalloc with kcalloc.

Replace kzalloc with kcalloc. As kcalloc is preferred for allocating an
array instead of kzalloc. This patch fixes the checkpatch issue.
Signed-off-by: NVarsha Rao <rvarsha016@gmail.com>
上级 41390895
...@@ -1849,7 +1849,7 @@ int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c, ...@@ -1849,7 +1849,7 @@ int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c,
if (state == IP_VS_STATE_MASTER) { if (state == IP_VS_STATE_MASTER) {
struct ipvs_master_sync_state *ms; struct ipvs_master_sync_state *ms;
ipvs->ms = kzalloc(count * sizeof(ipvs->ms[0]), GFP_KERNEL); ipvs->ms = kcalloc(count, sizeof(ipvs->ms[0]), GFP_KERNEL);
if (!ipvs->ms) if (!ipvs->ms)
goto out; goto out;
ms = ipvs->ms; ms = ipvs->ms;
...@@ -1862,7 +1862,7 @@ int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c, ...@@ -1862,7 +1862,7 @@ int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c,
ms->ipvs = ipvs; ms->ipvs = ipvs;
} }
} else { } else {
array = kzalloc(count * sizeof(struct task_struct *), array = kcalloc(count, sizeof(struct task_struct *),
GFP_KERNEL); GFP_KERNEL);
if (!array) if (!array)
goto out; goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册