Skip to content

Commit

Permalink
ANDROID: android-verity: Fix broken parameter handling.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
patils authored and Alistair Strachan committed Jul 26, 2018
1 parent 76905cc commit 5a591f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/md/dm-android-verity.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,16 +693,16 @@ static int android_verity_ctr(struct dm_target *ti, unsigned argc, char **argv)
handle_error();
return -EINVAL;
}
} else if (argc == 2)
key_id = argv[1];
else {
target_device = argv[0];
} else if (argc == 2) {
key_id = argv[0];
target_device = argv[1];
} else {
DMERR("Incorrect number of arguments");
handle_error();
return -EINVAL;
}

target_device = argv[0];

dev = name_to_dev_t(target_device);
if (!dev) {
DMERR("no dev found for %s", target_device);
Expand Down

0 comments on commit 5a591f8

Please sign in to comment.