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

Barry Song 21cnbao at gmail.com
Sun Mar 22 18:49:24 AEDT 2026


On Sun, Mar 22, 2026 at 1:43 PM Suren Baghdasaryan <surenb at google.com> 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 at google.com>
> Signed-off-by: Suren Baghdasaryan <surenb at google.com>
> Reviewed-by: Liam R. Howlett <Liam.Howlett at oracle.com>
> Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes at oracle.com>
> ---

LGTM,
Reviewed-by: Barry Song <baohua at kernel.org>


More information about the Linuxppc-dev mailing list