[ofw] Prevent mthca from dereferencing a NULL mdev pointer during shutdown.

Smith, Stan stan.smith at intel.com
Tue Mar 17 09:48:15 PDT 2009


Applied in svn.2033

Signed off by stan.smith at intel.com

diff U3 Z:/Documents and Settings/scsmith/My Documents/openIB-windows/SVN/gen1/trunk/hw/mthca/kernel/mthca_provider.c F:/openIB-windows-svn/latest/gen1/trunk/hw/mthca/kernel/mthca_provider.c
--- Z:/Documents and Settings/scsmith/My Documents/openIB-windows/SVN/gen1/trunk/hw/mthca/kernel/mthca_provider.c       Sun Oct 05 12:52:01 2008
+++ F:/openIB-windows-svn/latest/gen1/trunk/hw/mthca/kernel/mthca_provider.c    Wed Mar 11 15:52:35 2009
@@ -71,6 +71,8 @@

        if (mthca_is_livefish(mdev)) {
                props->max_pd = 1;
+               if ( !mdev || !mdev->ext )
+                       return err;
                props->vendor_id = mdev->ext->hcaConfig.VendorID;
                props->vendor_part_id = mdev->ext->hcaConfig.DeviceID;
                return 0;

Change debug ID from MLX4 --> MTHCA
WhiteSpace alignment.

diff U3 Z:/Documents and Settings/scsmith/My Documents/openIB-windows/SVN/gen1/trunk/hw/mthca/kernel/hca_pnp.c F:/openIB-windows-svn/latest/gen1/trunk/hw/mthca/kernel/hca_pnp.c
--- Z:/Documents and Settings/scsmith/My Documents/openIB-windows/SVN/gen1/trunk/hw/mthca/kernel/hca_pnp.c      Thu Mar 12 09:57:59 2009
+++ F:/openIB-windows-svn/latest/gen1/trunk/hw/mthca/kernel/hca_pnp.c   Thu Mar 12 11:02:55 2009
@@ -803,7 +803,7 @@
 __ref_ifc(
        IN                              DEVICE_OBJECT*                          p_dev_obj )
 {
-       hca_dev_ext_t                   *p_ext  = (hca_dev_ext_t*)p_dev_obj->DeviceExtension;
+       hca_dev_ext_t   *p_ext  = (hca_dev_ext_t*)p_dev_obj->DeviceExtension;

        HCA_ENTER( HCA_DBG_PNP );

@@ -811,7 +811,7 @@
        ObReferenceObject( p_dev_obj );

        HCA_PRINT( TRACE_LEVEL_ERROR, HCA_DBG_PNP,
-               ("MLX4_HCA: CA_guid %I64x, hca_ifc_ref %d\n",
+               ("MTHCA: CA_guid %I64x, hca_ifc_ref %d\n",
                p_ext->hca.guid, p_ext->n_hca_ifc_ref) );

        HCA_EXIT( HCA_DBG_PNP );
@@ -821,7 +821,7 @@
 __deref_ifc(
        IN                              DEVICE_OBJECT*                          p_dev_obj )
 {
-       hca_dev_ext_t                   *p_ext  = (hca_dev_ext_t*)p_dev_obj->DeviceExtension;
+       hca_dev_ext_t   *p_ext  = (hca_dev_ext_t*)p_dev_obj->DeviceExtension;

        HCA_ENTER( HCA_DBG_PNP );

@@ -829,7 +829,7 @@
        ObDereferenceObject( p_dev_obj );

        HCA_PRINT( TRACE_LEVEL_ERROR, HCA_DBG_PNP,
-               ("MLX4_HCA: CA_guid %I64x, hca_ifc_ref %d\n",
+               ("MTHCA: CA_guid %I64x, hca_ifc_ref %d\n",
                p_ext->hca.guid, p_ext->n_hca_ifc_ref) );

        HCA_EXIT( HCA_DBG_PNP );



-------------- next part --------------
A non-text attachment was scrubbed...
Name: mthca_provider.c.patch
Type: application/octet-stream
Size: 689 bytes
Desc: mthca_provider.c.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090317/35915d45/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hca_pnp.c.patch
Type: application/octet-stream
Size: 1483 bytes
Desc: hca_pnp.c.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090317/35915d45/attachment-0001.obj>


More information about the ofw mailing list