hantek-6xxx: fix potential NULL dereference
Check pointers' validity before dereferencing. This was reported by clang's scan-build.
This commit is contained in:
parent
b0e80e9aa9
commit
e93ca8a4d6
|
@ -460,6 +460,8 @@ static int config_list(uint32_t key, GVariant **data,
|
|||
*data = std_gvar_array_u32(ARRAY_AND_SIZE(devopts_cg));
|
||||
break;
|
||||
case SR_CONF_COUPLING:
|
||||
if (!devc)
|
||||
return SR_ERR_ARG;
|
||||
*data = g_variant_new_strv(devc->coupling_vals, devc->coupling_tab_size);
|
||||
break;
|
||||
case SR_CONF_VDIV:
|
||||
|
|
Loading…
Reference in New Issue