From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Dan Carpenter <dan.carpenter@linaro.org>,
Matthew Brost <matthew.brost@intel.com>
Cc: "Matthew Brost" <matthew.brost@intel.com>,
"Lucas De Marchi" <lucas.demarchi@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Himal Prasad Ghimiray" <himal.prasad.ghimiray@intel.com>,
intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH next] drm/xe: Fix uninitialized variable in xe_vm_bind_ioctl()
Date: Mon, 10 Mar 2025 12:56:46 -0400 [thread overview]
Message-ID: <Z88ZzoFA5KpQTLmH@intel.com> (raw)
In-Reply-To: <4a74b296-8b51-4dab-a2f1-69919da1ca62@stanley.mountain>
On Mon, Mar 10, 2025 at 01:48:00PM +0300, Dan Carpenter wrote:
> The error handling assumes that vm_bind_ioctl_check_args() will
> initialize "bind_ops" but there are a couple early returns where that's
> not true. Initialize "bind_ops" to NULL from the start.
It is not a couple, but only the one goto put_vm where this bind_ops
gets actually initialized, or not...
but perhaps the order in the exit is wrong and we should move the
kvfree(bind_ops) upper to the end of put_exec_queue?
Matt, thoughts on the order here?
Cc: Matthew Brost <matthew.brost@intel.com>
>
> Fixes: b43e864af0d4 ("drm/xe/uapi: Add DRM_XE_VM_BIND_FLAG_CPU_ADDR_MIRROR")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> drivers/gpu/drm/xe/xe_vm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
> index 22a26aff3a6e..d85759b958d0 100644
> --- a/drivers/gpu/drm/xe/xe_vm.c
> +++ b/drivers/gpu/drm/xe/xe_vm.c
> @@ -3287,7 +3287,7 @@ int xe_vm_bind_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
> struct xe_exec_queue *q = NULL;
> u32 num_syncs, num_ufence = 0;
> struct xe_sync_entry *syncs = NULL;
> - struct drm_xe_vm_bind_op *bind_ops;
> + struct drm_xe_vm_bind_op *bind_ops = NULL;
> struct xe_vma_ops vops;
> struct dma_fence *fence;
> int err;
> --
> 2.47.2
>
next prev parent reply other threads:[~2025-03-10 16:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-10 10:48 [PATCH next] drm/xe: Fix uninitialized variable in xe_vm_bind_ioctl() Dan Carpenter
2025-03-10 10:56 ` ✓ CI.Patch_applied: success for " Patchwork
2025-03-10 10:56 ` ✓ CI.checkpatch: " Patchwork
2025-03-10 10:57 ` ✓ CI.KUnit: " Patchwork
2025-03-10 11:14 ` ✓ CI.Build: " Patchwork
2025-03-10 11:16 ` ✓ CI.Hooks: " Patchwork
2025-03-10 11:18 ` ✓ CI.checksparse: " Patchwork
2025-03-10 16:56 ` Rodrigo Vivi [this message]
2025-03-10 18:22 ` [PATCH next] " Dan Carpenter
2025-03-11 5:04 ` Matthew Brost
2025-03-11 5:12 ` Matthew Brost
2025-03-12 6:17 ` Matthew Brost
2025-03-11 6:08 ` ✓ Xe.CI.BAT: success for " Patchwork
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=Z88ZzoFA5KpQTLmH@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=airlied@gmail.com \
--cc=dan.carpenter@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lucas.demarchi@intel.com \
--cc=matthew.brost@intel.com \
--cc=simona@ffwll.ch \
--cc=thomas.hellstrom@linux.intel.com \
/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