Merge tag 'afs-next-20190628' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs
Pull afs updates from David Howells: "A set of minor changes for AFS: - Remove an unnecessary check in afs_unlink() - Add a tracepoint for tracking callback management - Add a tracepoint for afs_server object usage - Use struct_size() - Add mappings for AFS UAE abort codes to Linux error codes, using symbolic names rather than hex numbers in the .c file" * tag 'afs-next-20190628' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: afs: Add support for the UAE error table fs/afs: use struct_size() in kzalloc() afs: Trace afs_server usage afs: Add some callback management tracepoints afs: afs_unlink() doesn't need to check dentry->d_inode
This commit is contained in:
@@ -310,8 +310,7 @@ int afs_page_filler(void *data, struct page *page)
|
||||
/* fall through */
|
||||
default:
|
||||
go_on:
|
||||
req = kzalloc(sizeof(struct afs_read) + sizeof(struct page *),
|
||||
GFP_KERNEL);
|
||||
req = kzalloc(struct_size(req, array, 1), GFP_KERNEL);
|
||||
if (!req)
|
||||
goto enomem;
|
||||
|
||||
@@ -461,8 +460,7 @@ static int afs_readpages_one(struct file *file, struct address_space *mapping,
|
||||
n++;
|
||||
}
|
||||
|
||||
req = kzalloc(sizeof(struct afs_read) + sizeof(struct page *) * n,
|
||||
GFP_NOFS);
|
||||
req = kzalloc(struct_size(req, array, n), GFP_NOFS);
|
||||
if (!req)
|
||||
return -ENOMEM;
|
||||
|
||||
|
Reference in New Issue
Block a user