Unverified Commit a5031f93 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14769 svcrdma: fix miss destroy percpu_counter in svc_rdma_proc_init()

parents a71a62a9 193ceac9
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -234,25 +234,34 @@ static int svc_rdma_proc_init(void)

	rc = percpu_counter_init(&svcrdma_stat_read, 0, GFP_KERNEL);
	if (rc)
		goto out_err;
		goto err;
	rc = percpu_counter_init(&svcrdma_stat_recv, 0, GFP_KERNEL);
	if (rc)
		goto out_err;
		goto err_read;
	rc = percpu_counter_init(&svcrdma_stat_sq_starve, 0, GFP_KERNEL);
	if (rc)
		goto out_err;
		goto err_recv;
	rc = percpu_counter_init(&svcrdma_stat_write, 0, GFP_KERNEL);
	if (rc)
		goto out_err;
		goto err_sq;

	svcrdma_table_header = register_sysctl("sunrpc/svc_rdma",
					       svcrdma_parm_table);
	if (!svcrdma_table_header)
		goto err_write;

	return 0;

out_err:
err_write:
	rc = -ENOMEM;
	percpu_counter_destroy(&svcrdma_stat_write);
err_sq:
	percpu_counter_destroy(&svcrdma_stat_sq_starve);
err_recv:
	percpu_counter_destroy(&svcrdma_stat_recv);
err_read:
	percpu_counter_destroy(&svcrdma_stat_read);
err:
	return rc;
}