From 69505c4f1203be6af703012a4f81ca6338b861a1 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 9 May 2019 13:03:05 +0200 Subject: 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 --- common/bbu.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- cgit v1.2.3