Skip to content

Commit

Permalink
libceph: allow ceph_buffer_put() to receive a NULL ceph_buffer
Browse files Browse the repository at this point in the history
[ Upstream commit 5c49895 ]

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>
  • Loading branch information
Luis Henriques authored and Greg Kroah-Hartman committed Sep 10, 2019
1 parent bce83d9 commit c3083ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/linux/ceph/buffer.h
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit c3083ef

Please sign in to comment.