public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: Francois Dugast <francois.dugast@intel.com>,
	intel-xe@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org, Arunpravin.PaneerSelvam@amd.com
Subject: Re: [PATCH v4 2/5] gpu/buddy: Remove redundant condition in alloc_from_freetree() error path
Date: Fri, 22 May 2026 11:10:19 +0100	[thread overview]
Message-ID: <bf22b4d7-c86e-407f-8bf4-19a6f9d7fa1e@intel.com> (raw)
In-Reply-To: <20260522092600.32818-3-francois.dugast@intel.com>

On 22/05/2026 10:25, Francois Dugast wrote:
> The err_undo label in alloc_from_freetree() is only reachable via a
> goto from inside the `while (tmp != order)` loop, which means tmp is
> guaranteed to differ from order at that point. The surrounding
> `if (tmp != order)` guard was therefore always true and can be dropped
> without any behavioral change.
> 
> Signed-off-by: Francois Dugast <francois.dugast@intel.com>

Reviewed-by: Matthew Auld <matthew.auld@intel.com>

> ---
>   drivers/gpu/buddy.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/buddy.c b/drivers/gpu/buddy.c
> index dac2027bb64a..9f6696f47f89 100644
> --- a/drivers/gpu/buddy.c
> +++ b/drivers/gpu/buddy.c
> @@ -849,10 +849,8 @@ alloc_from_freetree(struct gpu_buddy *mm,
>   	return block;
>   
>   err_undo:
> -	if (tmp != order) {
> -		rbtree_remove(mm, block);
> -		__gpu_buddy_free(mm, block, false);
> -	}
> +	rbtree_remove(mm, block);
> +	__gpu_buddy_free(mm, block, false);
>   	return ERR_PTR(err);
>   }
>   


  reply	other threads:[~2026-05-22 10:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-22  9:25 [PATCH v4 0/5] gpu/buddy: Per-order free and used block scoreboards Francois Dugast
2026-05-22  9:25 ` [PATCH v4 1/5] gpu/buddy: Fix use-after-free in split_block() call sites Francois Dugast
2026-05-25  9:06   ` Claude review: " Claude Code Review Bot
2026-05-22  9:25 ` [PATCH v4 2/5] gpu/buddy: Remove redundant condition in alloc_from_freetree() error path Francois Dugast
2026-05-22 10:10   ` Matthew Auld [this message]
2026-05-25  9:06   ` Claude review: " Claude Code Review Bot
2026-05-22  9:25 ` [PATCH v4 3/5] gpu/buddy: Introduce __gpu_buddy_undo_splits() helper Francois Dugast
2026-05-25  9:06   ` Claude review: " Claude Code Review Bot
2026-05-22  9:25 ` [PATCH v4 4/5] gpu/buddy: Track per-order free blocks with a scoreboard Francois Dugast
2026-05-25  9:06   ` Claude review: " Claude Code Review Bot
2026-05-22  9:25 ` [PATCH v4 5/5] gpu/buddy: Track per-order used " Francois Dugast
2026-05-22 10:25   ` Arunpravin Paneer Selvam
2026-05-22 10:56     ` Matthew Auld
2026-05-25  9:06   ` Claude review: " Claude Code Review Bot
2026-05-25  9:06 ` Claude review: gpu/buddy: Per-order free and used block scoreboards 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=bf22b4d7-c86e-407f-8bf4-19a6f9d7fa1e@intel.com \
    --to=matthew.auld@intel.com \
    --cc=Arunpravin.PaneerSelvam@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=francois.dugast@intel.com \
    --cc=intel-xe@lists.freedesktop.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