gprs_ns2: gprs_ns2_free_bind() should remove itself before removing nsvcs

When removing NSVCs before removing the bind from the SNS list, the removing NSVCs could
trigger a creation of a new NSVC on the same bind ending in a
while(true) loop.

Change-Id: I6f497348f75fb479427d8a4c23313e33fbc62036
This commit is contained in:
Alexander Couzens 2021-09-03 22:22:39 +02:00
parent 83f06cea0a
commit 4bfcce6c54
1 changed files with 4 additions and 4 deletions

View File

@ -1479,16 +1479,16 @@ void gprs_ns2_free_bind(struct gprs_ns2_vc_bind *bind)
return;
bind->freed = true;
llist_for_each_entry_safe(nsvc, tmp, &bind->nsvc, blist) {
gprs_ns2_free_nsvc(nsvc);
}
if (gprs_ns2_is_ip_bind(bind)) {
llist_for_each_entry(nse, &bind->nsi->nse, list) {
gprs_ns2_sns_del_bind(nse, bind);
}
}
llist_for_each_entry_safe(nsvc, tmp, &bind->nsvc, blist) {
gprs_ns2_free_nsvc(nsvc);
}
if (bind->driver->free_bind)
bind->driver->free_bind(bind);