pespin has uploaded this change for review.
sndcp: Allow cb users taking ownership of primitives
Change-Id: Ie3ddc835d8393e934d3f357108c81f639247c485
---
M src/sndcp/sndcp_prim.c
1 file changed, 17 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/86/32586/1
diff --git a/src/sndcp/sndcp_prim.c b/src/sndcp/sndcp_prim.c
index b9b5041..9281784 100644
--- a/src/sndcp/sndcp_prim.c
+++ b/src/sndcp/sndcp_prim.c
@@ -304,7 +304,10 @@
rc = g_sndcp_ctx->sndcp_up_cb(sndcp_prim, g_sndcp_ctx->sndcp_up_cb_user_data);
else
rc = sndcp_up_cb_dummy(sndcp_prim, g_sndcp_ctx->sndcp_up_cb_user_data);
- msgb_free(sndcp_prim->oph.msg);
+ if (rc != 1)
+ msgb_free(sndcp_prim->oph.msg);
+ else
+ rc = 0;
return rc;
}
@@ -443,7 +446,10 @@
rc = g_sndcp_ctx->sndcp_down_cb(llc_prim, g_sndcp_ctx->sndcp_down_cb_user_data);
else
rc = sndcp_down_cb_dummy(llc_prim, g_sndcp_ctx->sndcp_down_cb_user_data);
- msgb_free(llc_prim->oph.msg);
+ if (rc != 1)
+ msgb_free(llc_prim->oph.msg);
+ else
+ rc = 0;
return rc;
}
To view, visit change 32586. To unsubscribe, or for help writing mail filters, visit settings.