summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLuis Henriques <lhenriques@suse.com>2019-07-19 15:32:19 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-10 10:29:49 +0100
commitc3083eff1b1b3bdae7389ff0e2fb7ae9423561e4 (patch)
treeff3694bf5a9f3ad3c1624a69e84e2edff11f9ee2 /include
parentbce83d9ccca56b9ea9b7cd88499681d10d5062ea (diff)
libceph: allow ceph_buffer_put() to receive a NULL ceph_buffer
[ Upstream commit 5c498950f730aa17c5f8a2cdcb903524e4002ed2 ] Signed-off-by: Luis Henriques <lhenriques@suse.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ceph/buffer.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/ceph/buffer.h b/include/linux/ceph/buffer.h
index 07ca15e76100..dada47a4360f 100644
--- a/include/linux/ceph/buffer.h
+++ b/include/linux/ceph/buffer.h
@@ -29,7 +29,8 @@ static inline struct ceph_buffer *ceph_buffer_get(struct ceph_buffer *b)
static inline void ceph_buffer_put(struct ceph_buffer *b)
{
- kref_put(&b->kref, ceph_buffer_release);
+ if (b)
+ kref_put(&b->kref, ceph_buffer_release);
}
extern int ceph_decode_buffer(struct ceph_buffer **b, void **p, void *end);