From 6f6604c918f95fccce2e94966f7c9512b80fb27c Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 23 Mar 2017 16:18:48 +0100 Subject: state: storage: direct: do not close file that is not opened When open failed to not try to close the invalid fd afterwards. Signed-off-by: Sascha Hauer --- common/state/backend_bucket_direct.c | 1 - 1 file changed, 1 deletion(-) (limited to 'common') diff --git a/common/state/backend_bucket_direct.c b/common/state/backend_bucket_direct.c index b72e8adb96..4465ed0e41 100644 --- a/common/state/backend_bucket_direct.c +++ b/common/state/backend_bucket_direct.c @@ -156,7 +156,6 @@ int state_backend_bucket_direct_create(struct device_d *dev, const char *path, fd = open(path, O_RDWR); if (fd < 0) { dev_err(dev, "Failed to open file '%s', %d\n", path, -errno); - close(fd); return -errno; } -- cgit v1.2.3