[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190719143222.16058-2-lhenriques@suse.com>
Date: Fri, 19 Jul 2019 15:32:19 +0100
From: Luis Henriques <lhenriques@...e.com>
To: Ilya Dryomov <idryomov@...il.com>,
Jeff Layton <jlayton@...nel.org>, Sage Weil <sage@...hat.com>
Cc: ceph-devel@...r.kernel.org, linux-kernel@...r.kernel.org,
Luis Henriques <lhenriques@...e.com>
Subject: [PATCH 1/4] libceph: allow ceph_buffer_put() to receive a NULL ceph_buffer
Signed-off-by: Luis Henriques <lhenriques@...e.com>
---
include/linux/ceph/buffer.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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)
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);
Powered by blists - more mailing lists