Skip to contentSkip to conversation

habanalabs: correctly cast u64 to void*

PATCH In review Oded Gabbay 2 participants 2 messages May 31, 2020 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 habanalabs: correctly cast u64 to void*

Use the u64_to_user_ptr(x) kernel macro to correctly cast u64 to void*

---
 drivers/misc/habanalabs/command_submission.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/habanalabs/command_submission.c +1 -1
index 75d8302352e5..f82974a916c3 100644
@@ -789,7 +789,7 @@ static int cs_ioctl_signal_wait(struct hl_fpriv *hpriv, enum hl_cs_type cs_type,
 		size_to_copy = chunk->num_signal_seq_arr *
 				sizeof(*signal_seq_arr);
 		if (copy_from_user(signal_seq_arr,
-					(void __user *) chunk->signal_seq_arr,
+					u64_to_user_ptr(chunk->signal_seq_arr),
 					size_to_copy)) {
 			dev_err(hdev->dev,
 				"Failed to copy signal seq array from user\n");
Signature · 1 line
2.17.1