From: Ben Dooks <ben.dooks@codethink.co.uk>
To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
alexander.deucher@amd.com, christian.koenig@amd.com
Cc: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch,
Ben Dooks <ben.dooks@codethink.co.uk>
Subject: [PATCH] drm/radeon: fix __user annotation in radeon_info_ioctl()
Date: Wed, 11 Mar 2026 14:21:38 +0000 [thread overview]
Message-ID: <20260311142138.530006-1-ben.dooks@codethink.co.uk> (raw)
The radeon_info_ioctl() is obviously called from an ioctl()
entry for this device, and uses copy_{to,from)_user() on
the value_ptr variable.
This is generating sparse warnings due to use lack of __user
annotation on the value_ptr, so add this to remove the
following warnings:
drivers/gpu/drm/radeon/radeon_kms.c:262:43: warning: incorrect type in argument 2 (different address spaces)
drivers/gpu/drm/radeon/radeon_kms.c:262:43: expected void const [noderef] __user *from
drivers/gpu/drm/radeon/radeon_kms.c:262:43: got unsigned int [usertype] *[assigned] value_ptr
drivers/gpu/drm/radeon/radeon_kms.c:319:43: warning: incorrect type in argument 2 (different address spaces)
drivers/gpu/drm/radeon/radeon_kms.c:319:43: expected void const [noderef] __user *from
drivers/gpu/drm/radeon/radeon_kms.c:319:43: got unsigned int [usertype] *[assigned] value_ptr
drivers/gpu/drm/radeon/radeon_kms.c:331:43: warning: incorrect type in argument 2 (different address spaces)
drivers/gpu/drm/radeon/radeon_kms.c:331:43: expected void const [noderef] __user *from
drivers/gpu/drm/radeon/radeon_kms.c:331:43: got unsigned int [usertype] *[assigned] value_ptr
drivers/gpu/drm/radeon/radeon_kms.c:467:43: warning: incorrect type in argument 2 (different address spaces)
drivers/gpu/drm/radeon/radeon_kms.c:467:43: expected void const [noderef] __user *from
drivers/gpu/drm/radeon/radeon_kms.c:467:43: got unsigned int [usertype] *[assigned] value_ptr
drivers/gpu/drm/radeon/radeon_kms.c:592:43: warning: incorrect type in argument 2 (different address spaces)
drivers/gpu/drm/radeon/radeon_kms.c:592:43: expected void const [noderef] __user *from
drivers/gpu/drm/radeon/radeon_kms.c:592:43: got unsigned int [usertype] *[assigned] value_ptr
drivers/gpu/drm/radeon/radeon_kms.c:609:26: warning: incorrect type in argument 1 (different address spaces)
drivers/gpu/drm/radeon/radeon_kms.c:609:26: expected void [noderef] __user *to
drivers/gpu/drm/radeon/radeon_kms.c:609:26: got unsigned int [usertype] *[assigned] value_ptr
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
drivers/gpu/drm/radeon/radeon_kms.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index dc43fd790a9c..57bc60c33937 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -231,13 +231,14 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
struct radeon_device *rdev = dev->dev_private;
struct drm_radeon_info *info = data;
struct radeon_mode_info *minfo = &rdev->mode_info;
- uint32_t *value, value_tmp, *value_ptr, value_size;
+ uint32_t *value, value_tmp, value_size;
+ uint32_t __user *value_ptr;
struct ttm_resource_manager *man;
uint64_t value64;
struct drm_crtc *crtc;
int i, found;
- value_ptr = (uint32_t *)((unsigned long)info->value);
+ value_ptr = (uint32_t __user *)((unsigned long)info->value);
value = &value_tmp;
value_size = sizeof(uint32_t);
--
2.37.2.352.g3c44437643
next reply other threads:[~2026-03-11 14:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-11 14:21 Ben Dooks [this message]
2026-03-11 20:51 ` Claude review: drm/radeon: fix __user annotation in radeon_info_ioctl() Claude Code Review Bot
2026-03-11 20:51 ` Claude Code Review Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260311142138.530006-1-ben.dooks@codethink.co.uk \
--to=ben.dooks@codethink.co.uk \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=simona@ffwll.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox