aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ceph/buffer.h
diff options
context:
space:
mode:
authorLuis Henriques <lhenriques@suse.com>2019-07-19 10:32:19 -0400
committerIlya Dryomov <idryomov@gmail.com>2019-08-22 04:47:41 -0400
commit5c498950f730aa17c5f8a2cdcb903524e4002ed2 (patch)
treecbe2391f2f19fef4fca845b76bfde12b9428f853 /include/linux/ceph/buffer.h
parentd1abaeb3be7b5fa6d7a1fbbd2e14e3310005c4c1 (diff)
libceph: allow ceph_buffer_put() to receive a NULL ceph_buffer
Signed-off-by: Luis Henriques <lhenriques@suse.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'include/linux/ceph/buffer.h')
-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 5e58bb29b1a3..11cdc7c60480 100644
--- a/include/linux/ceph/buffer.h
+++ b/include/linux/ceph/buffer.h
@@ -30,7 +30,8 @@ static inline struct ceph_buffer *ceph_buffer_get(struct ceph_buffer *b)
30 30
31static inline void ceph_buffer_put(struct ceph_buffer *b) 31static inline void ceph_buffer_put(struct ceph_buffer *b)
32{ 32{
33 kref_put(&b->kref, ceph_buffer_release); 33 if (b)
34 kref_put(&b->kref, ceph_buffer_release);
34} 35}
35 36
36extern int ceph_decode_buffer(struct ceph_buffer **b, void **p, void *end); 37extern int ceph_decode_buffer(struct ceph_buffer **b, void **p, void *end);