Private
Public Access
2
0

gpio: only call ferror in free() case as dev has already been free'd by swig code

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-05-06 18:12:53 +01:00
parent d82cae1312
commit ecc2c92027

View File

@@ -211,15 +211,16 @@ maa_gpio_unexport(maa_gpio_context *dev)
fwrite(bu, sizeof(char), length, unexport_f);
fclose(unexport_f);
if (ferror(dev->value_fp) != 0) {
return MAA_ERROR_INVALID_RESOURCE;
}
return MAA_SUCCESS;
}
maa_result_t
maa_gpio_close(maa_gpio_context *dev)
{
if (ferror(dev->value_fp) != 0) {
return MAA_ERROR_INVALID_RESOURCE;
}
maa_gpio_unexport(dev);
free(dev);
return MAA_SUCCESS;