diff options
author | Sandeep Patil <sspatil@google.com> | 2018-07-24 16:59:40 -0700 |
---|---|---|
committer | Amit Pundir <amit.pundir@linaro.org> | 2018-08-30 16:16:10 +0530 |
commit | 6410737aa675e483f410c96d075c103d37de1e11 (patch) | |
tree | 455efe86612973208a29c14e2d1c7e9f7dcebe0e | |
parent | baa61b695bd272497bd7ecd449f3858c887c4df0 (diff) | |
download | linaro-android-6410737aa675e483f410c96d075c103d37de1e11.tar.gz |
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>
-rw-r--r-- | drivers/md/dm-android-verity.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/md/dm-android-verity.c b/drivers/md/dm-android-verity.c index ce8dcfdee264..20e05936551f 100644 --- a/drivers/md/dm-android-verity.c +++ b/drivers/md/dm-android-verity.c @@ -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); |