Opened file handle should be closed before function exit. Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx> --- super-intel.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/super-intel.c b/super-intel.c index 471dbd2..01ffcc8 100644 --- a/super-intel.c +++ b/super-intel.c @@ -8550,8 +8550,10 @@ int wait_for_reshape_imsm(struct mdinfo *sra, unsigned long long to_complete, sysfs_set_str(sra, NULL, "sync_max", "max"); to_complete = MaxSector; } else { - if (completed > to_complete) + if (completed > to_complete) { + close(fd); return -1; + } if (sysfs_set_num(sra, NULL, "sync_max", to_complete / ndata) != 0) { close(fd); -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html