diff options
| author | Francois Dugast <francois.dugast@intel.com> | 2026-05-22 11:25:29 +0200 |
|---|---|---|
| committer | Francois Dugast <francois.dugast@intel.com> | 2026-05-29 13:44:00 +0200 |
| commit | 51d28339bfefe1ed603820669534440465f5dc46 (patch) | |
| tree | fae4acbb556ba300190b9af0a7db02b3b7e3cc06 /drivers/gpu/buddy.c | |
| parent | 0251963afd22d1365d07bf81135ef0c694f6c3b5 (diff) | |
| download | linux-next-51d28339bfefe1ed603820669534440465f5dc46.tar.gz linux-next-51d28339bfefe1ed603820669534440465f5dc46.zip | |
gpu/buddy: Remove redundant condition in alloc_from_freetree() error path
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.
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://lore.kernel.org/r/20260522092600.32818-3-francois.dugast@intel.com
Signed-off-by: Francois Dugast <francois.dugast@intel.com>
Diffstat (limited to 'drivers/gpu/buddy.c')
| -rw-r--r-- | drivers/gpu/buddy.c | 6 |
1 files 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); } |
