Skip to content

Commit

Permalink
handlers: ubivol: fix missing device strlen check
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Dominique Martinet <[email protected]>
  • Loading branch information
S4mw1s3 authored and sbabic committed Jun 20, 2024
1 parent f490889 commit ef7a4ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion handlers/ubivol_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ef7a4ae

Please sign in to comment.