Skip to contentSkip to conversation

be2iscsi: remove potential junk pointer free

PATCH In review Tomas Henzl 3 participants 3 messages Jun 6, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

---

drivers/scsi/be2iscsi/be_mgmt.c +1 -3
index 6045aa7..07934b0 100644
@@ -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) {
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Tomas Henzl
Quoted 13 lines · Tomas Henzl

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

---

drivers/scsi/be2iscsi/be_mgmt.c +0 -0
index 6045aa7..07934b0 100644
@@ -1008,10 +1008,8 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
 		BE2_IPV6 : BE2_IPV4 ;

drivers/scsi/be2iscsi/be_mgmt.c int mgmt_set_ip(struct beiscsi_hba *phba, · line 1015

Quoted 10 lines
drivers/scsi/be2iscsi/be_mgmt.c +1 -3
 
 	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) {