public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: John Harrison <john.c.harrison@intel.com>,
	Colin Ian King <colin.i.king@gmail.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	 Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Julia Filipchuk <julia.filipchuk@intel.com>,
	intel-xe@lists.freedesktop.org,  dri-devel@lists.freedesktop.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] drm/xe/guc: Fix inverted logic on snapshot->copy check
Date: Thu, 10 Oct 2024 14:57:52 +0200	[thread overview]
Message-ID: <648981da5fcf3118b10932eabc07b74c99bf53f4.camel@linux.intel.com> (raw)
In-Reply-To: <7feb0520-0cd3-46fc-8b44-a78d1c3a65bf@intel.com>

On Wed, 2024-10-09 at 09:32 -0700, John Harrison wrote:
> On 10/9/2024 09:05, Colin Ian King wrote:
> > Currently the check to see if snapshot->copy has been allocated is
> > inverted and ends up dereferencing snapshot->copy when free'ing
> > objects in the array when it is null or not free'ing the objects
> > when snapshot->copy is allocated. Fix this by using the correct
> > non-null pointer check logic.
> > 
> > Fixes: d8ce1a977226 ("drm/xe/guc: Use a two stage dump for GuC logs
> > and add more info")
> > Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
> 
> Thanks for the fix.

Pushed to drm-xe-next. Thanks.

/Thomas



> 
> > ---
> >   drivers/gpu/drm/xe/xe_guc_log.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/xe/xe_guc_log.c
> > b/drivers/gpu/drm/xe/xe_guc_log.c
> > index 93921f04153f..cc70f448d879 100644
> > --- a/drivers/gpu/drm/xe/xe_guc_log.c
> > +++ b/drivers/gpu/drm/xe/xe_guc_log.c
> > @@ -122,7 +122,7 @@ void xe_guc_log_snapshot_free(struct
> > xe_guc_log_snapshot *snapshot)
> >   	if (!snapshot)
> >   		return;
> >   
> > -	if (!snapshot->copy) {
> > +	if (snapshot->copy) {
> >   		for (i = 0; i < snapshot->num_chunks; i++)
> >   			kfree(snapshot->copy[i]);
> >   		kfree(snapshot->copy);
> 


      reply	other threads:[~2024-10-10 12:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09 16:05 [PATCH][next] drm/xe/guc: Fix inverted logic on snapshot->copy check Colin Ian King
2024-10-09 16:32 ` John Harrison
2024-10-10 12:57   ` Thomas Hellström [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=648981da5fcf3118b10932eabc07b74c99bf53f4.camel@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=colin.i.king@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=john.c.harrison@intel.com \
    --cc=julia.filipchuk@intel.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucas.demarchi@intel.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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