mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 06:10:56 +00:00
xprtrdma: fix incorrect header size calculations
commit912288442c
upstream. 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> [bwh: Backported to 4.19: adjust context] Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a36809948e
commit
4103bc54d8
1 changed files with 2 additions and 2 deletions
|
@ -72,7 +72,7 @@ static unsigned int rpcrdma_max_call_header_size(unsigned int maxsegs)
|
||||||
|
|
||||||
/* Maximum Read list size */
|
/* Maximum Read list size */
|
||||||
maxsegs += 2; /* segment for head and tail buffers */
|
maxsegs += 2; /* segment for head and tail buffers */
|
||||||
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 */
|
||||||
|
@ -98,7 +98,7 @@ static unsigned int rpcrdma_max_reply_header_size(unsigned int maxsegs)
|
||||||
|
|
||||||
/* Maximum Write list size */
|
/* Maximum Write list size */
|
||||||
maxsegs += 2; /* segment for head and tail buffers */
|
maxsegs += 2; /* segment for head and tail buffers */
|
||||||
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 a new issue