From: Sam Van Den Berge <
sam.van....@gmail.com>
Commit "5604c225 handlers: ubivol: Allow specifying MTD device" breaks UBI A/B
volume updates with an atomic swap at the end of the update because 1 strlen
check is missing in ubi_volume_get_info.
This fixes the following error:
[ERROR] : SWUPDATE failed [0] ERROR : does not exist
[ERROR] : SWUPDATE failed [0] ERROR : could not found UBI volume root_r
[ERROR] : SWUPDATE failed [0] ERROR : execute postinstall scripts failed
[ERROR] : SWUPDATE failed [1] Installation failed !
Signed-off-by: Sam Van Den Berge <
sam.van....@gmail.com>
---
handlers/ubivol_handler.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/handlers/ubivol_handler.c b/handlers/ubivol_handler.c
index 9db6472e..0ad0321e 100644
--- a/handlers/ubivol_handler.c
+++ b/handlers/ubivol_handler.c
@@ -506,7 +506,7 @@ static int ubi_volume_get_info(char *device, char *name, int *dev_num, int *vol_
{
struct ubi_part *ubi_part;
- if (device)
+ if (strlen(device))
ubi_part = search_volume_local(device, name);
else
ubi_part = search_volume_global(name);
--
2.43.0