From: Andy Grover Date: Thu, 4 Feb 2010 03:41:52 +0000 (-0800) Subject: RDS: Add a warning if trying to allocate 0 sgs X-Git-Tag: v2.6.37-rc1~147^2~499^2~73 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee4c7b47e46a9dea789aadb8279c8505f755b3ee;p=platform%2Fupstream%2Fkernel-adaptation-pc.git 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 --- 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 *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);