Skip to contentSkip to conversation

drm/ttm: add __user annotation in radeon_ttm_vram_read

PATCH In review Rasmus Villemoes 3 participants 3 messages Oct 24, 2020 – Apr 1, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/ttm: add __user annotation in radeon_ttm_vram_read

Keep sparse happy by preserving the __user annotation when casting.

---

kernel test robot has already started spamming me due to 9c5743dff. If I don't fix those warnings I'll keep getting those emails for months, so let me do the easy ones.

 drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_ttm.c +1 -1
index 36150b7f31a90aa1eece..ecfe88b0a35d8f317712 100644
@@ -1005,7 +1005,7 @@ static ssize_t radeon_ttm_vram_read(struct file *f, char __user *buf,
 		value = RREG32(RADEON_MM_DATA);
 		spin_unlock_irqrestore(&rdev->mmio_idx_lock, flags);
 
-		r = put_user(value, (uint32_t *)buf);
+		r = put_user(value, (uint32_t __user *)buf);
 		if (r)
 			return r;
 
Signature · 1 line
2.23.0
Reviewed-by on v1 1/1
#1 lore raw

Am 24.10.20 um 02:47 schrieb Rasmus Villemoes:

Quoted 4 lines

Keep sparse happy by preserving the __user annotation when casting.

Going over old patches and stumbled over that once.

Alex did you missed to pick it up?

Regards,
Christian.

Quoted 15 lines

---

kernel test robot has already started spamming me due to 9c5743dff. If I don't fix those warnings I'll keep getting those emails for months, so let me do the easy ones.

  drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_ttm.c +0 -0
index 36150b7f31a90aa1eece..ecfe88b0a35d8f317712 100644

drivers/gpu/drm/radeon/radeon_ttm.c static ssize_t radeon_ttm_vram_read(struct file *f, char __user *buf, · line 1011

Quoted 8 lines
drivers/gpu/drm/radeon/radeon_ttm.c +1 -1
@@ -1005,7 +1005,7 @@ static ssize_t radeon_ttm_vram_read(struct file *f, char __user *buf,
  		value = RREG32(RADEON_MM_DATA);
  		spin_unlock_irqrestore(&rdev->mmio_idx_lock, flags);
 
-		r = put_user(value, (uint32_t *)buf);
+		r = put_user(value, (uint32_t __user *)buf);
  		if (r)
  			return r;
 

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw

Current code already contains the fix.

Alex

Quoted 44 lines · Christian König

Am 24.10.20 um 02:47 schrieb Rasmus Villemoes:

Quoted 4 lines

Keep sparse happy by preserving the __user annotation when casting.

Going over old patches and stumbled over that once.

Alex did you missed to pick it up?

Regards,
Christian.

Quoted 15 lines

---

kernel test robot has already started spamming me due to 9c5743dff. If I don't fix those warnings I'll keep getting those emails for months, so let me do the easy ones.

  drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_ttm.c +0 -0
index 36150b7f31a90aa1eece..ecfe88b0a35d8f317712 100644

drivers/gpu/drm/radeon/radeon_ttm.c static ssize_t radeon_ttm_vram_read(struct file *f, char __user *buf, · line 1011

Quoted 8 lines
drivers/gpu/drm/radeon/radeon_ttm.c +1 -1
@@ -1005,7 +1005,7 @@ static ssize_t radeon_ttm_vram_read(struct file *f, char __user *buf,
              value = RREG32(RADEON_MM_DATA);
              spin_unlock_irqrestore(&rdev->mmio_idx_lock, flags);
 
-             r = put_user(value, (uint32_t *)buf);
+             r = put_user(value, (uint32_t __user *)buf);
              if (r)
                      return r;
 

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx