From: taoqi 30043660 taoqi10@huawei.com
The FD handle is repeatedly released when the "goto err_read" statement is executed.
Signed-off-by: taoqi 30043660 taoqi10@huawei.com --- wd_mempool.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/wd_mempool.c b/wd_mempool.c index ffb2f47..a051791 100644 --- a/wd_mempool.c +++ b/wd_mempool.c @@ -650,14 +650,13 @@ static int get_value_from_sysfs(const char *path, ssize_t path_size) goto err_read; }
- close(fd); - ret = strtol(buf, NULL, 10); if (errno == ERANGE) { WD_ERR("failed to strtol %s, out of range!\n", buf); goto err_read; }
+ close(fd); return ret;
err_read: