summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-03-23 16:18:48 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-31 18:43:53 +0200
commit6f6604c918f95fccce2e94966f7c9512b80fb27c (patch)
treecf3ada68996070df18880ca8ce12fb70fd754061 /common
parent95dfbdcf9db252cc63db04d43cd76ad73467fa08 (diff)
downloadbarebox-6f6604c918f95fccce2e94966f7c9512b80fb27c.tar.gz
barebox-6f6604c918f95fccce2e94966f7c9512b80fb27c.tar.xz
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 <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/state/backend_bucket_direct.c1
1 files changed, 0 insertions, 1 deletions
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;
}