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:
parent
08eba2d301
commit
aedbf89d85
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue