sms: Fix crash by saving the gsm_network
The conn might be released during the loop and then conn->bts is a null pointer and we end up crashing. Store the gsm_network in a local variable and access this one.
This commit is contained in:
parent
583e9aef33
commit
79eff7eeff
|
@ -1187,10 +1187,13 @@ void _gsm411_sms_trans_free(struct gsm_trans *trans)
|
|||
void gsm411_sapi_n_reject(struct gsm_subscriber_connection *conn)
|
||||
{
|
||||
struct gsm_subscriber *subscr;
|
||||
struct gsm_network *net;
|
||||
struct gsm_trans *trans, *tmp;
|
||||
|
||||
subscr = subscr_get(conn->subscr);
|
||||
llist_for_each_entry_safe(trans, tmp, &conn->bts->network->trans_list, entry)
|
||||
net = conn->bts->network;
|
||||
|
||||
llist_for_each_entry_safe(trans, tmp, &net->trans_list, entry)
|
||||
if (trans->conn == conn) {
|
||||
struct gsm_sms *sms = trans->sms.sms;
|
||||
if (!sms) {
|
||||
|
|
Loading…
Reference in New Issue