Explicitly initialize all struct parameters on init
This commit is contained in:
parent
17f63de642
commit
c2523f2213
3
std.c
3
std.c
|
@ -47,12 +47,13 @@ SR_PRIV int std_hw_init(struct sr_context *sr_ctx, struct sr_dev_driver *di,
|
|||
return SR_ERR_ARG;
|
||||
}
|
||||
|
||||
if (!(drvc = g_try_malloc0(sizeof(struct drv_context)))) {
|
||||
if (!(drvc = g_try_malloc(sizeof(struct drv_context)))) {
|
||||
sr_err("%sDriver context malloc failed.", prefix);
|
||||
return SR_ERR_MALLOC;
|
||||
}
|
||||
|
||||
drvc->sr_ctx = sr_ctx;
|
||||
drvc->instances = NULL;
|
||||
di->priv = drvc;
|
||||
|
||||
return SR_OK;
|
||||
|
|
Loading…
Reference in New Issue