diff options
author | Thomas Klein <osstklei@de.ibm.com> | 2007-01-22 06:52:20 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-01-23 00:59:20 -0500 |
commit | 061bf3cdba753ae7b52fba8cc324d81adac77696 (patch) | |
tree | 71a4d892ffe50f8f016e8afacc55e8f58bfcc269 /drivers/net/ehea/ehea_main.c | |
parent | 9f6d55d0846dd8628fd3eac15be377c4d3493c3e (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/net/ehea/ehea_main.c')
-rw-r--r-- | drivers/net/ehea/ehea_main.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; |