summaryrefslogtreecommitdiffstats
path: root/net/rds
diff options
context:
space:
mode:
authorAndy Grover <andy.grover@oracle.com>2010-02-04 04:41:52 +0100
committerAndy Grover <andy.grover@oracle.com>2010-09-09 03:12:03 +0200
commitee4c7b47e46a9dea789aadb8279c8505f755b3ee (patch)
tree6528275276bcd963b0d8fcd3fadac39e6d6c3e6f /net/rds
parentRDS: Do not set op_active in r_m_copy_from_user(). (diff)
downloadlinux-ee4c7b47e46a9dea789aadb8279c8505f755b3ee.tar.xz
linux-ee4c7b47e46a9dea789aadb8279c8505f755b3ee.zip
RDS: Add a warning if trying to allocate 0 sgs
rds_message_alloc_sgs() only works when nents is nonzero. Signed-off-by: Andy Grover <andy.grover@oracle.com>
Diffstat (limited to '')
-rw-r--r--net/rds/message.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/rds/message.c b/net/rds/message.c
index f4c3be0878e9..1f73a7358a8e 100644
--- a/net/rds/message.c
+++ b/net/rds/message.c
@@ -240,6 +240,7 @@ struct scatterlist *rds_message_alloc_sgs(struct rds_message *rm, int nents)
struct scatterlist *sg_ret;
WARN_ON(rm->m_used_sgs + nents > rm->m_total_sgs);
+ WARN_ON(!nents);
sg_ret = &sg_first[rm->m_used_sgs];
sg_init_table(sg_ret, nents);