param: add error check to dev_param_set_generic()
The function dev_param_set_generic() may fail because of out of memory. If so, return -ENOMEM. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
a1b347f24c
commit
31cbf0880d
|
@ -114,7 +114,7 @@ int dev_param_set_generic(struct device_d *dev, struct param_d *p,
|
|||
return 0;
|
||||
}
|
||||
p->value = strdup(val);
|
||||
return 0;
|
||||
return p->value ? 0 : -ENOMEM;
|
||||
}
|
||||
|
||||
static const char *param_get_generic(struct device_d *dev, struct param_d *p)
|
||||
|
|
Loading…
Reference in New Issue