Re: [PATCH v4 1/4] mm/vma: cleanup error handling path in vma_expand()

From: Barry Song

Date: Sun Mar 22 2026 - 03:49:43 EST


On Sun, Mar 22, 2026 at 1:43 PM Suren Baghdasaryan <surenb@xxxxxxxxxx> wrote:
>
> vma_expand() error handling is a bit confusing with "if (ret) return ret;"
> mixed with "if (!ret && ...) ret = ...;". Simplify the code to check
> for errors and return immediately after an operation that might fail.
> This also makes later changes to this function more readable.
> Change variable name for storing the error code from "ret" to "err".
>
> No functional change intended.
>
> Suggested-by: Jann Horn <jannh@xxxxxxxxxx>
> Signed-off-by: Suren Baghdasaryan <surenb@xxxxxxxxxx>
> Reviewed-by: Liam R. Howlett <Liam.Howlett@xxxxxxxxxx>
> Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>
> ---

LGTM,
Reviewed-by: Barry Song <baohua@xxxxxxxxxx>