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]
Date:	Wed, 26 Nov 2014 13:42:26 -0800
From:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:	SF Markus Elfring <elfring@...rs.sourceforge.net>
Cc:	devel@...verdev.osuosl.org, LKML <linux-kernel@...r.kernel.org>,
	kernel-janitors@...r.kernel.org,
	Julia Lawall <julia.lawall@...6.fr>
Subject: Re: [PATCH 2/2] staging: android: ion: One function call less in
 ion_buffer_create() after error detection

On Sun, Nov 23, 2014 at 07:44:08PM +0100, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Sun, 23 Nov 2014 19:12:29 +0100
> 
> The jump label "err1" was used by the ion_buffer_create() function in case of
> a memory allocation failure just to pass a null pointer to a vfree() function
> call by a data structure element.
> This implementation detail could be improved by the deletion of this
> inappropriate jump label.
> 
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> ---
>  drivers/staging/android/ion/ion.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
> index df12cc3..7a26b85 100644
> --- a/drivers/staging/android/ion/ion.c
> +++ b/drivers/staging/android/ion/ion.c
> @@ -226,7 +226,7 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
>  		buffer->pages = vmalloc(sizeof(struct page *) * num_pages);
>  		if (!buffer->pages) {
>  			ret = -ENOMEM;
> -			goto err1;
> +			goto err2;
>  		}
>  
>  		for_each_sg(table->sgl, sg, table->nents, i) {
> @@ -262,7 +262,6 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
>  err:
>  	heap->ops->unmap_dma(heap, buffer);
>  	heap->ops->free(buffer);
> -err1:
>  	vfree(buffer->pages);
>  err2:

Now we have "err" and "err2", which doesn't make much sense, please fix
up.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ