pespin submitted this change.

View Change


Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved
sndcp: Allow cb users taking ownership of primitives

Change-Id: Ie3ddc835d8393e934d3f357108c81f639247c485
---
M src/sndcp/sndcp_prim.c
1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/sndcp/sndcp_prim.c b/src/sndcp/sndcp_prim.c
index b9b5041..0472d17 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;
}

@@ -581,7 +587,10 @@
rc = g_sndcp_ctx->sndcp_snsm_cb(sndcp_prim, g_sndcp_ctx->sndcp_snsm_cb_user_data);
else
rc = sndcp_snsm_cb_dummy(sndcp_prim, g_sndcp_ctx->sndcp_snsm_cb_user_data);
- msgb_free(sndcp_prim->oph.msg);
+ if (rc != 1)
+ msgb_free(sndcp_prim->oph.msg);
+ else
+ rc = 0;
return rc;
}


To view, visit change 32586. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: Ie3ddc835d8393e934d3f357108c81f639247c485
Gerrit-Change-Number: 32586
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged