From: Chad Dupuis <cdupuis@redhat.com> Date: Wed, 17 Nov 2010 14:09:36 -0500 Subject: [net] qlcnic: Fix missing error codes Message-id: <20101117140936.3241.17050.sendpatchset@localhost.localdomain> Patchwork-id: 29460 O-Subject: [RHEL 5.6 PATCH] qlcnic: Fix missing error codes. Bugzilla: 637194 RH-Acked-by: Bob Picco <bpicco@redhat.com> RH-Acked-by: David S. Miller <davem@redhat.com> Bugzilla -------- Bug 637194 (https://bugzilla.redhat.com/show_bug.cgi?id=637194) Upstream Status --------------- net-2.6 commit id 8cfdce080722101a7fd2a1eff9763ca4008ec626 Brew Build ---------- 2896776 Testing ------- This patch was test built against the 2.6.18-232.el5 kernel. The issue from the bugzilla was reproduced and the fix comfirmed by Qlogic. Description ----------- Bad driver data was causing the shutdown() method of the driver to panic. This was caused by not returning a negative value from the probe() function which falsely caused the PCI discovery code to think that the probe for the device had succeeded. This patch returns the correct error values when the the probe function fails. >From da3bdd85aa39b0bc1533f23023b52909836c404f Mon Sep 17 00:00:00 2001 From: root <root@lotus.lab.bos.redhat.com> Date: Tue, 16 Nov 2010 09:35:22 -0500 Subject: [PATCH] qlcnic: Fix missing error codes. In the original code, the error codes returned from some of the functions are not caught and sent up the caller chain. Fixed it here. Signed-off-by: Sony Chacko <sony.chacko@qlogic.com> Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com> diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index dbb1b76..95170d9 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c @@ -829,7 +829,8 @@ qlcnic_start_firmware(struct qlcnic_adapter *adapter) if (load_fw_file) qlcnic_request_firmware(adapter); else { - if (qlcnic_check_flash_fw_ver(adapter)) + err = qlcnic_check_flash_fw_ver(adapter); + if (err) goto err_out; adapter->fw_type = QLCNIC_FLASH_ROMIMAGE; @@ -874,7 +875,9 @@ wait_init: qlcnic_idc_debug_info(adapter, 1); qlcnic_check_options(adapter); - if (qlcnic_reset_npar_config(adapter)) + + err = qlcnic_reset_npar_config(adapter); + if (err) goto err_out; qlcnic_dev_set_npar_ready(adapter); @@ -1395,7 +1398,8 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (qlcnic_read_mac_addr(adapter)) dev_warn(&pdev->dev, "failed to read mac addr\n"); - if (qlcnic_setup_idc_param(adapter)) + err = qlcnic_setup_idc_param(adapter); + if (err) goto err_out_iounmap; err = adapter->nic_ops->start_firmware(adapter);