aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorThomas Klein <osstklei@de.ibm.com>2007-01-22 06:52:20 -0500
committerJeff Garzik <jeff@garzik.org>2007-01-23 00:59:20 -0500
commit061bf3cdba753ae7b52fba8cc324d81adac77696 (patch)
tree71a4d892ffe50f8f016e8afacc55e8f58bfcc269 /drivers
parent9f6d55d0846dd8628fd3eac15be377c4d3493c3e (diff)
ehea: Fixed wrong dereferencation
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ehea/ehea.h2
-rw-r--r--drivers/net/ehea/ehea_main.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 39ad9f73d1ec..be10a3a26b5b 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -39,7 +39,7 @@
39#include <asm/io.h> 39#include <asm/io.h>
40 40
41#define DRV_NAME "ehea" 41#define DRV_NAME "ehea"
42#define DRV_VERSION "EHEA_0043" 42#define DRV_VERSION "EHEA_0044"
43 43
44#define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \ 44#define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
45 | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR) 45 | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 83fa32f72398..49f669c4b019 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -2471,14 +2471,16 @@ static int __devinit ehea_probe(struct ibmebus_dev *dev,
2471 2471
2472 adapter_handle = (u64*)get_property(dev->ofdev.node, "ibm,hea-handle", 2472 adapter_handle = (u64*)get_property(dev->ofdev.node, "ibm,hea-handle",
2473 NULL); 2473 NULL);
2474 if (!adapter_handle) { 2474 if (adapter_handle)
2475 adapter->handle = *adapter_handle;
2476
2477 if (!adapter->handle) {
2475 dev_err(&dev->ofdev.dev, "failed getting handle for adapter" 2478 dev_err(&dev->ofdev.dev, "failed getting handle for adapter"
2476 " '%s'\n", dev->ofdev.node->full_name); 2479 " '%s'\n", dev->ofdev.node->full_name);
2477 ret = -ENODEV; 2480 ret = -ENODEV;
2478 goto out_free_ad; 2481 goto out_free_ad;
2479 } 2482 }
2480 2483
2481 adapter->handle = *adapter_handle;
2482 adapter->pd = EHEA_PD_ID; 2484 adapter->pd = EHEA_PD_ID;
2483 2485
2484 dev->ofdev.dev.driver_data = adapter; 2486 dev->ofdev.dev.driver_data = adapter;