[lustre-devel] [PATCH] Mark a pointer as an userspace pointer using __user macro.

Antoine BLIN antoine.blin at lip6.fr
Sun Apr 10 05:46:40 PDT 2016


This change fixes below sparse error: "error: incompatible types
in comparison expression (different address spaces)"

Signed-off-by: Antoine BLIN <antoine.blin at lip6.fr>
---
 drivers/staging/lustre/lnet/selftest/conrpc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c
index 2be9451..1fdabb3 100644
--- a/drivers/staging/lustre/lnet/selftest/conrpc.c
+++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
@@ -490,10 +490,10 @@ lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t *trans,
 				   sizeof(struct list_head)))
 			return -EFAULT;
 
-		if (tmp.next == head_up)
-			return 0;
+		next = (struct list_head __user *)tmp.next;
 
-		next = tmp.next;
+		if (next == head_up)
+			return 0;
 
 		ent = list_entry(next, lstcon_rpc_ent_t, rpe_link);
 
-- 
2.7.4



More information about the lustre-devel mailing list