Przeglądaj źródła

sunrpc: fix warning in net/sunrpc/xprtrdma/svc_rdma_transport.c

this warning:

  net/sunrpc/xprtrdma/svc_rdma_transport.c: In function ‘svc_rdma_accept’:
  net/sunrpc/xprtrdma/svc_rdma_transport.c:830: warning: ‘dma_mr_acc’ may be used uninitialized in this function

triggers because GCC does not recognize the (correct) flow connection
between need_dma_mr and dma_mr_acc.

Annotate it.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ingo Molnar 16 lat temu
rodzic
commit
ed72b9c6e0
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      net/sunrpc/xprtrdma/svc_rdma_transport.c

+ 1 - 1
net/sunrpc/xprtrdma/svc_rdma_transport.c

@@ -827,7 +827,7 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
 	struct rdma_conn_param conn_param;
 	struct ib_qp_init_attr qp_attr;
 	struct ib_device_attr devattr;
-	int dma_mr_acc;
+	int uninitialized_var(dma_mr_acc);
 	int need_dma_mr;
 	int ret;
 	int i;