Re: [PATCH] b2iscsi: Fix memory leak in mgmt_set_ip()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




>> diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
>> index 07934b0..a3e5648 100644
>> --- a/drivers/scsi/be2iscsi/be_mgmt.c
>> +++ b/drivers/scsi/be2iscsi/be_mgmt.c
>> @@ -1015,7 +1015,7 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
>>  		if (if_info->dhcp_state) {
>>  			beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG,
>>  				    "BG_%d : DHCP Already Enabled\n");
>> -			return 0;
>> +			goto exit;
> 
> rc should be initialised - so this needs to be added to your patch

It is initialized at the beginning of the function, and it must contain zero when the "goto exit" is executed.

int mgmt_set_ip(struct beiscsi_hba *phba,
                struct iscsi_iface_param_info *ip_param,
                struct iscsi_iface_param_info *subnet_param,
                uint32_t boot_proto)
{
        struct be_cmd_get_def_gateway_resp gtway_addr_set;
        struct be_cmd_get_if_info_resp *if_info;
        struct be_cmd_set_dhcp_req *dhcpreq;
        struct be_cmd_rel_dhcp_req *reldhcp;
        struct be_dma_mem nonemb_cmd;
        uint8_t *gtway_addr;
        uint32_t ip_type;
        int rc;

        if (mgmt_get_all_if_id(phba))
                return -EIO;

        ip_type = (ip_param->param == ISCSI_NET_PARAM_IPV6_ADDR) ?
                BE2_IPV6 : BE2_IPV4 ;

        rc = mgmt_get_if_info(phba, ip_type, &if_info); <-------------- here
        if (rc)
                return rc;

        if (boot_proto == ISCSI_BOOTPROTO_DHCP) {
                if (if_info->dhcp_state) {
                        beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG,
                                    "BG_%d : DHCP Already Enabled\n");
                        goto exit;
                }

Regards,
Maurizio Lombardi
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux