sysclk-lwla: silence potential NULL dereference compiler warning

Check pointers' validity before dereferencing them.

This was reported by clang's scan-build.
This commit is contained in:
Gerhard Sittig 2018-02-09 19:30:00 +01:00 committed by Uwe Hermann
parent 08eba2d301
commit aedbf89d85
1 changed files with 2 additions and 0 deletions

View File

@ -588,6 +588,8 @@ static int config_list(uint32_t key, GVariant **data,
(devc) ? devc->model->num_devopts : 0); (devc) ? devc->model->num_devopts : 0);
} }
if (!devc)
return SR_ERR_ARG;
if (!has_devopt(devc->model, key | SR_CONF_LIST)) if (!has_devopt(devc->model, key | SR_CONF_LIST))
return SR_ERR_NA; return SR_ERR_NA;