mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] samples cn_test: fix cn leakage
@ 2020-06-26  3:52 libolingjl
  0 siblings, 0 replies; only message in thread
From: libolingjl @ 2020-06-26  3:52 UTC (permalink / raw)
  To: davem, gregkh; +Cc: linux-kernel, liboling

From: liboling <libolingjl@163.com>

Error return when add the second cn_test_id,
we need del the first cn_test_id.

Signed-off-by: liboling <libolingjl@163.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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-26  3:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-26  3:52 [PATCH] samples cn_test: fix cn leakage libolingjl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®