summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-05-09 13:03:05 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-05-10 08:18:25 +0200
commit69505c4f1203be6af703012a4f81ca6338b861a1 (patch)
tree39a106795497275112bc66ab4acf79a93d6ab4c2 /common
parent28a95cd4a0d0be2b84e4f2dc9dcd1d7411c33ecf (diff)
downloadbarebox-69505c4f1203be6af703012a4f81ca6338b861a1.tar.gz
bbu: In bbu_register_std_file_update detect device before accessing it
The device the standard file update handler writes to may not be present before detecting it, so as a first step detect it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/bbu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/bbu.c b/common/bbu.c
index 3271d40..00bec32 100644
--- a/common/bbu.c
+++ b/common/bbu.c
@@ -299,6 +299,8 @@ static int bbu_std_file_handler(struct bbu_handler *handler,
return -EINVAL;
}
+ device_detect_by_name(devpath_to_name(data->devicefile));
+
ret = stat(data->devicefile, &s);
if (ret) {
oflags |= O_CREAT;