From: Bartosz Golaszewski Date: Mon, 13 Apr 2015 09:44:14 +0000 (+0200) Subject: baylibre-acme: Add a missing return value check. X-Git-Tag: libsigrok-0.4.0~526 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=192d37e728b13393e9987f3cc888670b60efd197;p=libsigrok.git baylibre-acme: Add a missing return value check. Check the return value of sr_gpio_setval_export() in bl_acme_set_power_off() and return an appropriate error if the call fails. Signed-off-by: Bartosz Golaszewski --- diff --git a/src/hardware/baylibre-acme/protocol.c b/src/hardware/baylibre-acme/protocol.c index d0552553..f8fdb595 100644 --- a/src/hardware/baylibre-acme/protocol.c +++ b/src/hardware/baylibre-acme/protocol.c @@ -424,6 +424,11 @@ SR_PRIV int bl_acme_set_power_off(const struct sr_channel_group *cg, } val = sr_gpio_setval_export(pws_gpios[cgp->index], off ? 0 : 1); + if (val < 0) { + sr_err("Error setting power-off state: gpio: %d", + pws_gpios[cgp->index]); + return SR_ERR_IO; + } return SR_OK; }