[bug report] svcrdma: Add recvfrom helpers to svc_rdma_rw.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Chuck Lever,

The patch 026d958b38c6: "svcrdma: Add recvfrom helpers to
svc_rdma_rw.c" from Jun 23, 2017, leads to the following static
checker warning:

	net/sunrpc/xprtrdma/svc_rdma_rw.c:689 svc_rdma_build_read_chunk()
	error: uninitialized symbol 'ret'.

net/sunrpc/xprtrdma/svc_rdma_rw.c
   663  static int svc_rdma_build_read_chunk(struct svc_rqst *rqstp,
   664                                       struct svc_rdma_read_info *info,
   665                                       __be32 *p)
   666  {
   667          int ret;
   668  
   669          info->ri_chunklen = 0;
   670          while (*p++ != xdr_zero) {
                       ^^^^^^^^^^^^^^^^
Is this necessarily true for the first iteration through the loop?

   671                  u32 rs_handle, rs_length;
   672                  u64 rs_offset;
   673  
   674                  if (be32_to_cpup(p++) != info->ri_position)
   675                          break;
                                ^^^^^
It feels like this should be -EINVAL.

   676                  rs_handle = be32_to_cpup(p++);
   677                  rs_length = be32_to_cpup(p++);
   678                  p = xdr_decode_hyper(p, &rs_offset);
   679  
   680                  ret = svc_rdma_build_read_segment(info, rqstp,
   681                                                    rs_handle, rs_length,
   682                                                    rs_offset);
   683                  if (ret < 0)
   684                          break;
   685  
   686                  info->ri_chunklen += rs_length;
   687          }
   688  
   689          return ret;
   690  }

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux