mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 21:21:41 +00:00
nfs: Remove unnecessary NULL check before kfree()
Since kfree() already checks if its argument is NULL, an additional check before calling kfree() is unnecessary and can be removed. Remove it and thus also the following Coccinelle/coccicheck warning reported by ifnullfree.cocci: WARNING: NULL check before some freeing functions is not needed Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
This commit is contained in:
parent
bb8e4ce500
commit
e343678ee9
@ -48,8 +48,7 @@ static struct nfs_pgio_header *nfs_readhdr_alloc(void)
|
||||
|
||||
static void nfs_readhdr_free(struct nfs_pgio_header *rhdr)
|
||||
{
|
||||
if (rhdr->res.scratch != NULL)
|
||||
kfree(rhdr->res.scratch);
|
||||
kfree(rhdr->res.scratch);
|
||||
kmem_cache_free(nfs_rdata_cachep, rhdr);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user