lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e518ae77-57bf-44b2-a0c7-0891ec80d03a@web.de>
Date: Tue, 6 Aug 2024 17:20:24 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>,
 dri-devel@...ts.freedesktop.org, Daniel Vetter <daniel@...ll.ch>,
 David Airlie <airlied@...il.com>,
 Laurent Pinchart <laurent.pinchart@...asonboard.com>,
 Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
 Maxime Ripard <mripard@...nel.org>,
 Sebastian Reichel <sebastian.reichel@...labora.com>,
 Thomas Zimmermann <tzimmermann@...e.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
 Dan Carpenter <dan.carpenter@...aro.org>
Subject: Re: [PATCH 3/3] drm/omap: Fix locking in omap_gem_new_dmabuf()

…
> +++ b/drivers/gpu/drm/omapdrm/omap_gem.c
…
> @@ -1418,21 +1416,17 @@ struct drm_gem_object *omap_gem_new_dmabuf(struct drm_device *dev, size_t size,
>  		pages = kcalloc(npages, sizeof(*pages), GFP_KERNEL);
>  		if (!pages) {
>  			omap_gem_free_object(obj);
> -			obj = ERR_PTR(-ENOMEM);
> -			goto done;
> +			return ERR_PTR(-ENOMEM);
>  		}
>
>  		omap_obj->pages = pages;
>  		ret = drm_prime_sg_to_page_array(sgt, pages, npages);
>  		if (ret) {
>  			omap_gem_free_object(obj);
> -			obj = ERR_PTR(-ENOMEM);
> -			goto done;
> +			return ERR_PTR(-ENOMEM);
>  		}
…

I suggest to use another goto chain instead so that a bit of exception handling
can be better reused at the end of this function implementation.

Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ