提交 ee4c7b47 编写于 作者: A Andy Grover

RDS: Add a warning if trying to allocate 0 sgs

rds_message_alloc_sgs() only works when nents is nonzero.
Signed-off-by: NAndy Grover <andy.grover@oracle.com>
上级 372cd7de
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册