Re: [PATCH 1/1] be2iscsi: remove potential junk pointer free
On Jun 6, 2014, at 7:22 AM, 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 > --- > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/1] be2iscsi: remove potential junk pointer free
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 Looks good, Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/1] be2iscsi: remove potential junk pointer free
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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html