diff options
authorPau Espin Pedrol <pespin@sysmocom.de>2020-06-08 20:26:44 +0200
committerlaforge <laforge@osmocom.org>2020-06-09 07:36:21 +0000
commit89c6b8a42e6262320d129c3c68862618c4410fc1 (patch)
parentb90318808b2fcf5b8ee25f0129f02af19dd13c91 (diff)
e1_input: refcount inc line during e1_sign_link_create, not during line update
Increase reference count when a new sign_link using the line is created. Otherwise the line is freed too quickly during e1inp_sign_link_destroy() with several TRX being used, since each RSL link is missing a reference. That extra refcoutny in update() is not really needed given that we already have a link assigned on the line when we call update. Fixes: OS#3612 Fixes: OS#4094 Change-Id: I74405b0e87a89c17d58e87024f4aedbd30832013
1 files changed, 2 insertions, 2 deletions
diff --git a/src/e1_input.c b/src/e1_input.c
index 7066acf..9ea4f17 100644
--- a/src/e1_input.c
+++ b/src/e1_input.c
@@ -586,6 +586,8 @@ e1inp_sign_link_create(struct e1inp_ts *ts, enum e1inp_sign_type type,
link->tei = tei;
link->sapi = sapi;
+ e1inp_line_get(link->ts->line);
llist_add_tail(&link->list, &ts->sign.sign_links);
return link;
@@ -855,8 +857,6 @@ int e1inp_line_update(struct e1inp_line *line)
struct input_signal_data isd;
int i, rc;
- e1inp_line_get(line);
if (line->driver && line->ops && line->driver->line_update) {
rc = line->driver->line_update(line);
} else