[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200626035214.22709-1-libolingjl@163.com>
Date: Fri, 26 Jun 2020 11:52:14 +0800
From: libolingjl@....com
To: davem@...emloft.net, gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org, liboling <libolingjl@....com>
Subject: [PATCH] samples cn_test: fix cn leakage
From: liboling <libolingjl@....com>
Error return when add the second cn_test_id,
we need del the first cn_test_id.
Signed-off-by: liboling <libolingjl@....com>
---
samples/connector/cn_test.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/samples/connector/cn_test.c b/samples/connector/cn_test.c
index 0958a171d0..275e3f9082 100644
--- a/samples/connector/cn_test.c
+++ b/samples/connector/cn_test.c
@@ -151,6 +151,7 @@ static int cn_test_init(void)
cn_test_id.val++;
err = cn_add_callback(&cn_test_id, cn_test_name, cn_test_callback);
if (err) {
+ cn_test_id.val--;
cn_del_callback(&cn_test_id);
goto err_out;
}
--
2.17.1
Powered by blists - more mailing lists