summaryrefslogtreecommitdiff
path: root/net/rds/message.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2013-05-28 10:09:22 +0200
committerJiri Kosina <jkosina@suse.cz>2013-05-28 10:09:29 +0200
commit864bfb25b57a6766ea689befa5cf09a4353281ce (patch)
tree478941ca6e76b8d77b71f5827a3ce751c46a72b5 /net/rds/message.c
parent071361d3473ebb8142907470ff12d59c59f6be72 (diff)
parent49717cb40410fe4b563968680ff7c513967504c6 (diff)
downloadlwn-864bfb25b57a6766ea689befa5cf09a4353281ce.tar.gz
lwn-864bfb25b57a6766ea689befa5cf09a4353281ce.zip
Merge branch 'master' into for-next
Merge with 49717cb ("kthread: Document ways of reducing OS jitter due to per-CPU kthreads") to be able to apply fixup patch on top of it. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'net/rds/message.c')
-rw-r--r--net/rds/message.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/rds/message.c b/net/rds/message.c
index f0a4658f3273..aba232f9f308 100644
--- a/net/rds/message.c
+++ b/net/rds/message.c
@@ -82,10 +82,7 @@ static void rds_message_purge(struct rds_message *rm)
void rds_message_put(struct rds_message *rm)
{
rdsdebug("put rm %p ref %d\n", rm, atomic_read(&rm->m_refcount));
- if (atomic_read(&rm->m_refcount) == 0) {
-printk(KERN_CRIT "danger refcount zero on %p\n", rm);
-WARN_ON(1);
- }
+ WARN(!atomic_read(&rm->m_refcount), "danger refcount zero on %p\n", rm);
if (atomic_dec_and_test(&rm->m_refcount)) {
BUG_ON(!list_empty(&rm->m_sock_item));
BUG_ON(!list_empty(&rm->m_conn_item));
@@ -197,6 +194,9 @@ struct rds_message *rds_message_alloc(unsigned int extra_len, gfp_t gfp)
{
struct rds_message *rm;
+ if (extra_len > KMALLOC_MAX_SIZE - sizeof(struct rds_message))
+ return NULL;
+
rm = kzalloc(sizeof(struct rds_message) + extra_len, gfp);
if (!rm)
goto out;