projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9852d85
)
ceph: use struct_size() helper in __ceph_pool_perm_get()
author
Thorsten Blum
<thorsten.blum@toblux.com>
Thu, 12 Sep 2024 15:39:24 +0000
(17:39 +0200)
committer
Ilya Dryomov
<idryomov@gmail.com>
Thu, 3 Oct 2024 07:31:08 +0000
(09:31 +0200)
Use struct_size() to calculate the number of bytes to be allocated.
Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/addr.c
patch
|
blob
|
history
diff --git
a/fs/ceph/addr.c
b/fs/ceph/addr.c
index
53fef25
..
1d97a53
100644
(file)
--- a/
fs/ceph/addr.c
+++ b/
fs/ceph/addr.c
@@
-2145,7
+2145,7
@@
static int __ceph_pool_perm_get(struct ceph_inode_info *ci,
}
pool_ns_len = pool_ns ? pool_ns->len : 0;
- perm = kmalloc(s
izeof(*perm) + pool_ns_len + 1
, GFP_NOFS);
+ perm = kmalloc(s
truct_size(perm, pool_ns, pool_ns_len + 1)
, GFP_NOFS);
if (!perm) {
err = -ENOMEM;
goto out_unlock;