mobile/gsm48_rr.c: fix NULL-pointer dereference in gsm48_rr_check_mode()

In some cases (e.g. at start up) ms->rrlayer may not be initialized.
Let's access ms->settings directly since we already have a pointer
to struct osmocom_ms.

Change-Id: Ia9720132fcda960dcecefab9ae48398946503dc4
This commit is contained in:
Vadim Yanitskiy 2019-11-17 17:39:20 +07:00
parent 2605d96720
commit afd5b8247f
1 changed files with 1 additions and 1 deletions

View File

@ -319,7 +319,7 @@ static uint8_t gsm48_rr_check_mode(struct osmocom_ms *ms, uint8_t chan_nr,
int gsm48_rr_alter_delay(struct osmocom_ms *ms)
{
struct gsm48_rrlayer *rr = &ms->rrlayer;
struct gsm_settings *set = &rr->ms->settings;
struct gsm_settings *set = &ms->settings;
if (rr->state != GSM48_RR_ST_DEDICATED)
return -EINVAL;