projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b0487ed
)
fs-verity: Use struct_size() helper in enable_verity()
author
Zhang Jianhua
<chris.zjh@huawei.com>
Thu, 19 May 2022 02:24:50 +0000
(10:24 +0800)
committer
Eric Biggers
<ebiggers@google.com>
Thu, 19 May 2022 16:53:33 +0000
(09:53 -0700)
Follow the best practice for allocating a variable-sized structure.
Signed-off-by: Zhang Jianhua <chris.zjh@huawei.com>
[ebiggers: adjusted commit message]
Signed-off-by: Eric Biggers <ebiggers@google.com>
Link:
https://lore.kernel.org/r/20220519022450.2434483-1-chris.zjh@huawei.com
fs/verity/enable.c
patch
|
blob
|
history
diff --git
a/fs/verity/enable.c
b/fs/verity/enable.c
index 0f953bae17476b03e0fc20bc072749dc8c9612c3..d52872c808fffed4024397bbf3511c35d0f6c9da 100644
(file)
--- a/
fs/verity/enable.c
+++ b/
fs/verity/enable.c
@@
-202,7
+202,7
@@
static int enable_verity(struct file *filp,
const struct fsverity_operations *vops = inode->i_sb->s_vop;
struct merkle_tree_params params = { };
struct fsverity_descriptor *desc;
- size_t desc_size = s
izeof(*desc) + arg->sig_size
;
+ size_t desc_size = s
truct_size(desc, signature, arg->sig_size)
;
struct fsverity_info *vi;
int err;