diff options
author | Zhengyuan Liu <liuzhengyuan@kylinos.cn> | 2019-06-20 18:12:17 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2019-06-20 18:12:17 +0100 |
commit | ee102584efd53547bf9a0810e80b56f99f4a9105 (patch) | |
tree | cd995a1511e4aa4c9ef6d2a488795d5a5b670693 /fs/afs/write.c | |
parent | 452181936931f0f08923aba5e04e1e9ef58c389f (diff) | |
download | linux-ee102584efd53547bf9a0810e80b56f99f4a9105.tar.gz linux-ee102584efd53547bf9a0810e80b56f99f4a9105.tar.bz2 linux-ee102584efd53547bf9a0810e80b56f99f4a9105.zip |
fs/afs: use struct_size() in kzalloc()
As Gustavo said in other patches doing the same replace, we can now
use the new struct_size() helper to avoid leaving these open-coded and
prone to type mistake.
Signed-off-by: Zhengyuan Liu <liuzhengyuan@kylinos.cn>
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs/write.c')
-rw-r--r-- | fs/afs/write.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/afs/write.c b/fs/afs/write.c index 8bcab95f1127..9cea9c40a4ef 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c @@ -48,8 +48,7 @@ static int afs_fill_page(struct afs_vnode *vnode, struct key *key, return 0; } - req = kzalloc(sizeof(struct afs_read) + sizeof(struct page *), - GFP_KERNEL); + req = kzalloc(struct_size(req, array, 1), GFP_KERNEL); if (!req) return -ENOMEM; |