Skip to content

Commit 5a591f8

Browse files
patilsAlistair Strachan
authored and
Alistair Strachan
committed
ANDROID: android-verity: Fix broken parameter handling.
android-verity documentation states that the target expectets the key, followed by the backing device on the commandline as follows "dm=system none ro,0 1 android-verity <public-key-id> <backing-partition>" However, the code actually expects the backing device as the first parameter. Fix that. Bug: 72722987 Change-Id: Ibd56c0220f6003bdfb95aa2d611f787e75a65c97 Signed-off-by: Sandeep Patil <sspatil@google.com>
1 parent 76905cc commit 5a591f8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/md/dm-android-verity.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -693,16 +693,16 @@ static int android_verity_ctr(struct dm_target *ti, unsigned argc, char **argv)
693693
handle_error();
694694
return -EINVAL;
695695
}
696-
} else if (argc == 2)
697-
key_id = argv[1];
698-
else {
696+
target_device = argv[0];
697+
} else if (argc == 2) {
698+
key_id = argv[0];
699+
target_device = argv[1];
700+
} else {
699701
DMERR("Incorrect number of arguments");
700702
handle_error();
701703
return -EINVAL;
702704
}
703705

704-
target_device = argv[0];
705-
706706
dev = name_to_dev_t(target_device);
707707
if (!dev) {
708708
DMERR("no dev found for %s", target_device);

0 commit comments

Comments
 (0)