[<prev] [next>] [day] [month] [year] [list]
Message-ID: <df40519c-1850-6dfc-35bf-bdcc2eb6c117@web.de>
Date: Wed, 15 Jul 2020 20:12:16 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Jing Xiangfeng <jingxiangfeng@...wei.com>,
dri-devel@...ts.freedesktop.org, nouveau@...ts.freedesktop.org
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org,
Ben Skeggs <bskeggs@...hat.com>,
Daniel Vetter <daniel@...ll.ch>,
David Airlie <airlied@...ux.ie>
Subject: Re: [PATCH] drm/nouveau: add the missed kfree() for
nouveau_bo_alloc()
> … to fix it.
I suggest to replace this wording by the tag “Fixes”.
…
> +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
> @@ -276,8 +276,10 @@ nouveau_bo_alloc(struct nouveau_cli *cli, u64 *size, int *align, u32 flags,
> break;
> }
>
> - if (WARN_ON(pi < 0))
> + if (WARN_ON(pi < 0)) {
> + kfree(nvbo);
> return ERR_PTR(-EINVAL);
> + }
I propose to move such common exception handling to the end of
this function implementation so that a bit of duplicate code will be avoided.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?id=e9919e11e219eaa5e8041b7b1a196839143e9125#n481
Regards,
Markus
Powered by blists - more mailing lists