rigol-ds: 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:26:42 +01:00 committed by Uwe Hermann
parent b04cbd0ba3
commit 0306ae30b6
1 changed files with 2 additions and 0 deletions

View File

@ -752,6 +752,8 @@ static int config_list(uint32_t key, GVariant **data,
case SR_CONF_DEVICE_OPTIONS:
if (!cg)
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
if (!devc)
return SR_ERR_ARG;
if (cg == devc->digital_group) {
*data = std_gvar_array_u32(NULL, 0);
return SR_OK;