Skip to contentSkip to conversation

kdbus: fix sparse address-space annotation

PATCH New David Herrmann 1 participant 1 message Jul 24, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kdbus: fix sparse address-space annotation

Make sure to properly annotate casts in 'struct iovec' if we cross address-spaces, to make sure sparse does not warn about them.

All those conversions are fine, as we are allowed to pass those kvecs through the iovec importer.

---
 ipc/kdbus/message.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
ipc/kdbus/message.c +2 -2
index 3520f45..27a5021 100644
@@ -920,7 +920,7 @@ struct kdbus_pool_slice *kdbus_staging_emit(struct kdbus_staging *staging,
 
 	/* msg.size */
 	v->iov_len = sizeof(msg_size);
-	v->iov_base = &msg_size;
+	v->iov_base = (void __user *)&msg_size;
 	++v;
 
 	/* msg (after msg.size) plus items */
@@ -937,7 +937,7 @@ struct kdbus_pool_slice *kdbus_staging_emit(struct kdbus_staging *staging,
 	if (meta_size > 0) {
 		/* metadata items */
 		v->iov_len = meta_size;
-		v->iov_base = meta_items;
+		v->iov_base = (void __user *)meta_items;
 		++v;
 
 		/* padding after metadata */
Signature · 1 line
2.4.6