From ce25baf06fe8ba80b0a4c7ff65fba9e1b1b7a67f Mon Sep 17 00:00:00 2001 From: bowgotsai Date: Wed, 25 Jan 2017 20:21:58 +0800 Subject: [PATCH] fs_mgr_verity: correct dm_target_spec->next dm_target_spec->next should be set to the next multiple of 8. It doesn't matter before because dm_ioctl->target_count is set to 1 so only the first dm_target_spec will be processed. Bug: None Test: check device can boot with dm-verity Change-Id: I96b9b0307a40b05640db06d1c614c16d8144bb47 --- fs_mgr/fs_mgr_verity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs_mgr/fs_mgr_verity.cpp b/fs_mgr/fs_mgr_verity.cpp index e368a8257..f6a14da3d 100644 --- a/fs_mgr/fs_mgr_verity.cpp +++ b/fs_mgr/fs_mgr_verity.cpp @@ -285,7 +285,7 @@ static int load_verity_table(struct dm_ioctl *io, const std::string &name, // set next target boundary verity_params += strlen(verity_params) + 1; - verity_params = (char*)(((unsigned long)verity_params + 7) & ~8); + verity_params = (char*)(((uintptr_t)verity_params + 7) & ~7); tgt->next = verity_params - buffer; // send the ioctl to load the verity table