All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] be2iscsi: remove potential junk pointer free
@ 2014-06-06 12:22 Tomas Henzl
  2014-06-06 14:09 ` Christoph Hellwig
  2014-06-06 17:08 ` Michael Christie
  0 siblings, 2 replies; 3+ messages in thread
From: Tomas Henzl @ 2014-06-06 12:22 UTC (permalink / raw)
  To: 'linux-scsi@vger.kernel.org', jayamohank, sony.john-n

commit 0e7c60c [SCSI] be2iscsi: fix memory leak in error path
fixed an potential junk pointer free if  mgmt_get_if_info() returned an error

fix it on one more place

Signed-off-by: Tomas Henzl <thenzl@redhat.com>
---
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index 6045aa7..07934b0 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -1008,10 +1008,8 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
 		BE2_IPV6 : BE2_IPV4 ;
 
 	rc = mgmt_get_if_info(phba, ip_type, &if_info);
-	if (rc) {
-		kfree(if_info);
+	if (rc)
 		return rc;
-	}
 
 	if (boot_proto == ISCSI_BOOTPROTO_DHCP) {
 		if (if_info->dhcp_state) {
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] be2iscsi: remove potential junk pointer free
  2014-06-06 12:22 [PATCH 1/1] be2iscsi: remove potential junk pointer free Tomas Henzl
@ 2014-06-06 14:09 ` Christoph Hellwig
  2014-06-06 17:08 ` Michael Christie
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2014-06-06 14:09 UTC (permalink / raw)
  To: Tomas Henzl; +Cc: 'linux-scsi@vger.kernel.org', jayamohank, sony.john-n

On Fri, Jun 06, 2014 at 02:22:44PM +0200, Tomas Henzl wrote:
> commit 0e7c60c [SCSI] be2iscsi: fix memory leak in error path
> fixed an potential junk pointer free if  mgmt_get_if_info() returned an error
> 
> fix it on one more place
> 
> Signed-off-by: Tomas Henzl <thenzl@redhat.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] be2iscsi: remove potential junk pointer free
  2014-06-06 12:22 [PATCH 1/1] be2iscsi: remove potential junk pointer free Tomas Henzl
  2014-06-06 14:09 ` Christoph Hellwig
@ 2014-06-06 17:08 ` Michael Christie
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Christie @ 2014-06-06 17:08 UTC (permalink / raw)
  To: Tomas Henzl; +Cc: linux-scsi@vger.kernel.org, jayamohank, sony.john-n


On Jun 6, 2014, at 7:22 AM, Tomas Henzl <thenzl@redhat.com> wrote:

> commit 0e7c60c [SCSI] be2iscsi: fix memory leak in error path
> fixed an potential junk pointer free if  mgmt_get_if_info() returned an error
> 
> fix it on one more place
> 
> Signed-off-by: Tomas Henzl <thenzl@redhat.com>
> ---
> diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
> index 6045aa7..07934b0 100644
> --- a/drivers/scsi/be2iscsi/be_mgmt.c
> +++ b/drivers/scsi/be2iscsi/be_mgmt.c
> @@ -1008,10 +1008,8 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
> 		BE2_IPV6 : BE2_IPV4 ;
> 
> 	rc = mgmt_get_if_info(phba, ip_type, &if_info);
> -	if (rc) {
> -		kfree(if_info);
> +	if (rc)
> 		return rc;
> -	}
> 
> 	if (boot_proto == ISCSI_BOOTPROTO_DHCP) {
> 		if (if_info->dhcp_state) {

Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-06 17:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-06 12:22 [PATCH 1/1] be2iscsi: remove potential junk pointer free Tomas Henzl
2014-06-06 14:09 ` Christoph Hellwig
2014-06-06 17:08 ` Michael Christie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.