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:
Holger Hans Peter Freyther 2010-12-27 23:25:53 +01:00
parent 583e9aef33
commit 79eff7eeff
1 changed files with 4 additions and 1 deletions

View File

@ -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) {