]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
be2iscsi: remove potential junk pointer free
authorTomas Henzl <thenzl@redhat.com>
Fri, 6 Jun 2014 12:22:44 +0000 (14:22 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 25 Jun 2014 11:29:05 +0000 (13:29 +0200)
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>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/be2iscsi/be_mgmt.c

index 6045aa78986ac1e7ee828e4aab859a457f52faff..07934b0b9ee100a47b5ac3961b0473759da4257c 100644 (file)
@@ -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) {