]> git.baikalelectronics.ru Git - kernel.git/commit
NFS: Add missing null check for failed allocation
authorColin Ian King <colin.king@canonical.com>
Mon, 6 Jan 2020 13:17:34 +0000 (13:17 +0000)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 15 Jan 2020 15:54:31 +0000 (10:54 -0500)
commita9d71b6cc30fa275bdf267bc6e807e7e83f84866
treee6963ce458c9b8d23abf96acdc7a2d48188c543d
parent9a2e1f135801f222fd7c62cc534f096e7a6abe06
NFS: Add missing null check for failed allocation

Currently the allocation of buf is not being null checked and
a null pointer dereference can occur when the memory allocation fails.
Fix this by adding a check and returning -ENOMEM.

Addresses-Coverity: ("Dereference null return")
Fixes: 6d972518b821 ("NFS: Add fs_context support.")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/nfs4namespace.c