[MLX4] fixed bug, causing crash in "livefish" mode. [mlnx: 3053]
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 1 Sep 2008 17:24:37 +0000 (17:24 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 1 Sep 2008 17:24:37 +0000 (17:24 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1542 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

hw/mlx4/kernel/hca/ca.c

index cfb53b6..3230a62 100644 (file)
@@ -165,16 +165,19 @@ mlnx_query_ca (
                goto err_byte_count;\r
        }\r
 \r
-       // query the device\r
+       // handle "livefish" case\r
+       RtlZeroMemory(&props, sizeof(props));\r
        if ( hca_is_livefish(hca2fdo(p_hca)) ) {\r
                struct pci_dev *pdev = hca2pdev(p_hca);\r
                props.max_pd = 1;\r
                props.vendor_id = pdev->ven_id;\r
                props.vendor_part_id = pdev->dev_id;\r
-               err = 0;\r
+               status = IB_SUCCESS;\r
+               goto done;\r
        }\r
-       else \r
-               err = p_ibdev->query_device(p_ibdev, &props);\r
+\r
+       // query the device\r
+       err = p_ibdev->query_device(p_ibdev, &props);\r
        if (err) {\r
                HCA_PRINT (TRACE_LEVEL_ERROR, HCA_DBG_SHIM, \r
                        ("ib_query_device failed (%d)\n",err));\r
@@ -335,6 +338,7 @@ err_user_unsupported:
        if( status != IB_INSUFFICIENT_MEMORY && status != IB_SUCCESS )\r
                HCA_PRINT(TRACE_LEVEL_ERROR, HCA_DBG_SHIM,\r
                ("completes with ERROR status %x\n", status));\r
+done:\r
        HCA_EXIT(HCA_DBG_SHIM);\r
        return status;\r
 }\r