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:	Tue, 28 Jun 2011 01:25:26 +0300
From:	Dan Carpenter <error27@...il.com>
To:	Jesper Juhl <jj@...osbits.net>
Cc:	"Nicholas A. Bellinger" <nab@...ux-iscsi.org>,
	James Bottomley <jbottomley@...allels.com>,
	Christoph Hellwig <hch@....de>, linux-scsi@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH][Resend] SCSI, target, loopback: Fix memory leak in
 tcm_loop_make_scsi_hba()

On Mon, Jun 27, 2011 at 11:54:48PM +0200, Jesper Juhl wrote:
> --- a/drivers/target/loopback/tcm_loop.c
> +++ b/drivers/target/loopback/tcm_loop.c
> @@ -1321,7 +1321,8 @@ struct se_wwn *tcm_loop_make_scsi_hba(
>  
>  	printk(KERN_ERR "Unable to locate prefix for emulated Target Port:"
>  			" %s\n", name);
> -	return ERR_PTR(-EINVAL);
> +	ret = -EINVAL;
> +	goto out;

You've added a weird bunny hop goto here.  It might be better to
change the if (ptr) check to if (!ptr) so we could fall through
here in the normal case.

>  
>  check_len:
>  	if (strlen(name) >= TL_WWN_ADDR_LEN) {

If this check fails then it calls kfree() and returns.  It would be
cleaner to "goto out" here as well.

regards,
dan carpenter
--
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