diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-05-09 13:03:05 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-05-10 08:18:25 +0200 |
commit | 69505c4f1203be6af703012a4f81ca6338b861a1 (patch) | |
tree | 39a106795497275112bc66ab4acf79a93d6ab4c2 | |
parent | 28a95cd4a0d0be2b84e4f2dc9dcd1d7411c33ecf (diff) | |
download | barebox-69505c4f1203be6af703012a4f81ca6338b861a1.tar.gz barebox-69505c4f1203be6af703012a4f81ca6338b861a1.tar.xz |
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>
-rw-r--r-- | common/bbu.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/common/bbu.c b/common/bbu.c index 3271d403b7..00bec32a86 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; |