mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 22:52:19 +02:00
xfs: Remove redundant NULL check after __GFP_NOFAIL
kzalloc() is called with __GFP_NOFAIL, so a NULL return is not expected. Drop the redundant !map check in xfs_dabuf_map(). Also switch the nirecs-sized allocation to kcalloc(). Signed-off-by: hongao <hongao@uniontech.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
parent
0ca1a8331c
commit
281cb17787
|
|
@ -2716,12 +2716,8 @@ xfs_dabuf_map(
|
|||
* larger one that needs to be free by the caller.
|
||||
*/
|
||||
if (nirecs > 1) {
|
||||
map = kzalloc(nirecs * sizeof(struct xfs_buf_map),
|
||||
GFP_KERNEL | __GFP_NOLOCKDEP | __GFP_NOFAIL);
|
||||
if (!map) {
|
||||
error = -ENOMEM;
|
||||
goto out_free_irecs;
|
||||
}
|
||||
map = kcalloc(nirecs, sizeof(struct xfs_buf_map),
|
||||
GFP_KERNEL | __GFP_NOLOCKDEP | __GFP_NOFAIL);
|
||||
*mapp = map;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user