cifs: check kmalloc before use
authorNicholas Mc Guire <hofrat@osadl.org>
Thu, 23 Aug 2018 10:24:02 +0000 (12:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Sep 2018 07:20:05 +0000 (09:20 +0200)
commitc773c4fbb22b8e31699c547b28ec3fb51555a810
treeb9adc19b46b7af1309b54c043f6043ba55798039
parentfbd314e29d27cb38f56e528ef06fde2b96daf7d1
cifs: check kmalloc before use

commit 126c97f4d0d1b5b956e8b0740c81a2b2a2ae548c upstream.

The kmalloc was not being checked - if it fails issue a warning
and return -ENOMEM to the caller.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Fixes: b8da344b74c8 ("cifs: dynamic allocation of ntlmssp blob")
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
cc: Stable <stable@vger.kernel.org>`
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/sess.c