]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: fix dereference of null pointer cf
authorColin Ian King <colin.king@canonical.com>
Sun, 29 Aug 2021 18:18:24 +0000 (19:18 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 3 Sep 2021 08:55:51 +0000 (10:55 +0200)
commitaadb3f5a43632bb9875279ad1b08336754c2fcb6
treec8c903b6b92af9be2cfaa031f2569508f81087bd
parent2759538cdb5dc9fddd080bfd1a6f78bbdb22cc83
ceph: fix dereference of null pointer cf

Currently in the case where kmem_cache_alloc fails the null pointer
cf is dereferenced when assigning cf->is_capsnap = false. Fix this
by adding a null pointer check and return path.

Cc: stable@vger.kernel.org
Addresses-Coverity: ("Dereference null return")
Fixes: 816dafc829e1 ("ceph: correctly handle releasing an embedded cap flush")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/caps.c