]> err.no Git - linux-2.6/commitdiff
ehea: Fixed wrong dereferencation
authorThomas Klein <osstklei@de.ibm.com>
Mon, 22 Jan 2007 11:52:20 +0000 (12:52 +0100)
committerJeff Garzik <jeff@garzik.org>
Tue, 23 Jan 2007 05:59:20 +0000 (00:59 -0500)
Not only check the pointer against 0 but also the dereferenced value

Signed-off-by: Thomas Klein <tklein@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/ehea/ehea.h
drivers/net/ehea/ehea_main.c

index 39ad9f73d1ecccf2229e298771dbba297f8b22c3..be10a3a26b5b4c04f0ffaf11bebad3d97436f797 100644 (file)
@@ -39,7 +39,7 @@
 #include <asm/io.h>
 
 #define DRV_NAME       "ehea"
-#define DRV_VERSION    "EHEA_0043"
+#define DRV_VERSION    "EHEA_0044"
 
 #define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
        | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
index 83fa32f7239857c9d6a72f05eca538343b00c76b..49f669c4b019649d9d7c010f38b9e72739e4b50c 100644 (file)
@@ -2471,14 +2471,16 @@ static int __devinit ehea_probe(struct ibmebus_dev *dev,
 
        adapter_handle = (u64*)get_property(dev->ofdev.node, "ibm,hea-handle",
                                            NULL);
-       if (!adapter_handle) {
+       if (adapter_handle)
+               adapter->handle = *adapter_handle;
+
+       if (!adapter->handle) {
                dev_err(&dev->ofdev.dev, "failed getting handle for adapter"
                        " '%s'\n", dev->ofdev.node->full_name);
                ret = -ENODEV;
                goto out_free_ad;
        }
 
-       adapter->handle = *adapter_handle;
        adapter->pd = EHEA_PD_ID;
 
        dev->ofdev.dev.driver_data = adapter;