xprtrdma: fix incorrect header size calculations
[ Upstream commit912288442c
] Currently the header size calculations are using an assignment operator instead of a += operator when accumulating the header size leading to incorrect sizes. Fix this by using the correct operator. Addresses-Coverity: ("Unused value") Fixes:302d3deb20
("xprtrdma: Prevent inline overflow") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
a75a8aabb2
commit
c8a4452da9
|
@ -71,7 +71,7 @@ static unsigned int rpcrdma_max_call_header_size(unsigned int maxsegs)
|
||||||
size = RPCRDMA_HDRLEN_MIN;
|
size = RPCRDMA_HDRLEN_MIN;
|
||||||
|
|
||||||
/* Maximum Read list size */
|
/* Maximum Read list size */
|
||||||
size = maxsegs * rpcrdma_readchunk_maxsz * sizeof(__be32);
|
size += maxsegs * rpcrdma_readchunk_maxsz * sizeof(__be32);
|
||||||
|
|
||||||
/* Minimal Read chunk size */
|
/* Minimal Read chunk size */
|
||||||
size += sizeof(__be32); /* segment count */
|
size += sizeof(__be32); /* segment count */
|
||||||
|
@ -96,7 +96,7 @@ static unsigned int rpcrdma_max_reply_header_size(unsigned int maxsegs)
|
||||||
size = RPCRDMA_HDRLEN_MIN;
|
size = RPCRDMA_HDRLEN_MIN;
|
||||||
|
|
||||||
/* Maximum Write list size */
|
/* Maximum Write list size */
|
||||||
size = sizeof(__be32); /* segment count */
|
size += sizeof(__be32); /* segment count */
|
||||||
size += maxsegs * rpcrdma_segment_maxsz * sizeof(__be32);
|
size += maxsegs * rpcrdma_segment_maxsz * sizeof(__be32);
|
||||||
size += sizeof(__be32); /* list discriminator */
|
size += sizeof(__be32); /* list discriminator */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue