commit | ee4c7b47e46a9dea789aadb8279c8505f755b3ee | [log] [tgz] |
---|---|---|
author | Andy Grover <andy.grover@oracle.com> | Wed Feb 03 19:41:52 2010 -0800 |
committer | Andy Grover <andy.grover@oracle.com> | Wed Sep 08 18:12:03 2010 -0700 |
tree | 6528275276bcd963b0d8fcd3fadac39e6d6c3e6f | |
parent | 372cd7dedfd1ea93a9ae8d9c282e910dc1b76773 [diff] [blame] |
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>
diff --git a/net/rds/message.c b/net/rds/message.c index f4c3be0..1f73a73 100644 --- a/net/rds/message.c +++ b/net/rds/message.c
@@ -240,6 +240,7 @@ 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);