[patch] vxge: potential NULL dereference

Dan Carpenter
2010-09-10T11:54:23Z

At the start of the function we test whether the "vpath" is NULL but we
need another test here as well.

Signed-off-by: Dan Carpenter <error27@gmail.com>
---
This is a static checker bug, I'm not sure if we ever pass a NULL
pointer for "vpath".

diff --git a/drivers/net/vxge/vxge-traffic.c b/drivers/net/vxge/vxge-traffic.c
index cedf08f..1790748 100644
--- a/drivers/net/vxge/vxge-traffic.c
+++ b/drivers/net/vxge/vxge-traffic.c
@@ -2157,7 +2157,8 @@ out2:
(alarm_event = VXGE_HW_EVENT_UNKNOWN))
return VXGE_HW_OK;

- __vxge_hw_device_handle_error(hldev, vpath->vp_id, alarm_event);
+ if (vpath)
+ __vxge_hw_device_handle_error(hldev, vpath->vp_id, alarm_event);

if (alarm_event = VXGE_HW_EVENT_SERR)
return VXGE_HW_ERR_CRITICAL;