From: Matthew Brost <matthew.brost@intel.com>
To: Matthew Auld <matthew.auld@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
Mika Kuoppala <mika.kuoppala@linux.intel.com>,
Nirmoy Das <nirmoy.das@intel.com>, <stable@vger.kernel.org>
Subject: Re: [PATCH] drm/xe/xe_sync: initialise ufence.signalled
Date: Sat, 12 Oct 2024 02:08:55 +0000 [thread overview]
Message-ID: <ZwnaN2zrvtEwPgzR@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20241011133633.388008-2-matthew.auld@intel.com>
On Fri, Oct 11, 2024 at 02:36:34PM +0100, Matthew Auld wrote:
> We can incorrectly think that the fence has signalled, if we get a
> non-zero value here from the kmalloc, which is quite plausible. Just use
> kzalloc to prevent stuff like this.
>
> Fixes: 977e5b82e090 ("drm/xe: Expose user fence from xe_sync_entry")
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
> Cc: Nirmoy Das <nirmoy.das@intel.com>
> Cc: <stable@vger.kernel.org> # v6.10+
> ---
> drivers/gpu/drm/xe/xe_sync.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_sync.c b/drivers/gpu/drm/xe/xe_sync.c
> index bb3c2a830362..c6cf227ead40 100644
> --- a/drivers/gpu/drm/xe/xe_sync.c
> +++ b/drivers/gpu/drm/xe/xe_sync.c
> @@ -58,7 +58,7 @@ static struct xe_user_fence *user_fence_create(struct xe_device *xe, u64 addr,
> if (!access_ok(ptr, sizeof(*ptr)))
> return ERR_PTR(-EFAULT);
>
> - ufence = kmalloc(sizeof(*ufence), GFP_KERNEL);
> + ufence = kzalloc(sizeof(*ufence), GFP_KERNEL);
> if (!ufence)
> return ERR_PTR(-ENOMEM);
>
> --
> 2.46.2
>
prev parent reply other threads:[~2024-10-12 2:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-11 13:36 [PATCH] drm/xe/xe_sync: initialise ufence.signalled Matthew Auld
2024-10-11 13:43 ` Nirmoy Das
2024-10-11 14:45 ` ✓ CI.Patch_applied: success for " Patchwork
2024-10-11 14:45 ` ✓ CI.checkpatch: " Patchwork
2024-10-11 14:46 ` ✓ CI.KUnit: " Patchwork
2024-10-11 14:58 ` ✓ CI.Build: " Patchwork
2024-10-11 15:00 ` ✓ CI.Hooks: " Patchwork
2024-10-11 15:02 ` ✓ CI.checksparse: " Patchwork
2024-10-11 15:30 ` ✓ CI.BAT: " Patchwork
2024-10-11 18:37 ` ✗ CI.FULL: failure " Patchwork
2024-10-12 2:08 ` Matthew Brost [this message]
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=ZwnaN2zrvtEwPgzR@DUT025-TGLU.fm.intel.com \
--to=matthew.brost@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.auld@intel.com \
--cc=mika.kuoppala@linux.intel.com \
--cc=nirmoy.das@intel.com \
--cc=stable@vger.kernel.org \
/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