Patchwork vxge: fix possible NULL dereference in vxge-traffic.c

login
register
mail settings
Submitter Alexander Beregalov
Date April 24, 2009, 1:31 a.m.
Message ID <1240536698-10821-1-git-send-email-a.beregalov@gmail.com>
Download mbox | patch
Permalink /patch/26395/
State Accepted
Delegated to: David Miller
Headers show

Comments

Alexander Beregalov - April 24, 2009, 1:31 a.m.
If vpath is NULL then hldev is NULL also.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
---
 drivers/net/vxge/vxge-traffic.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Ramkrishna Vepa - April 24, 2009, 2:46 a.m.
Good catch! This patch looks good.

Thanks,
Ram
> -----Original Message-----
> From: Alexander Beregalov [mailto:a.beregalov@gmail.com]
> Sent: Thursday, April 23, 2009 6:32 PM
> To: Ramkrishna Vepa; netdev@vger.kernel.org
> Cc: Alexander Beregalov
> Subject: [PATCH] vxge: fix possible NULL dereference in vxge-traffic.c
> 
> If vpath is NULL then hldev is NULL also.
> 
> Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
> ---
>  drivers/net/vxge/vxge-traffic.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/vxge/vxge-traffic.c b/drivers/net/vxge/vxge-
> traffic.c
> index 7be0ae1..506625b 100644
> --- a/drivers/net/vxge/vxge-traffic.c
> +++ b/drivers/net/vxge/vxge-traffic.c
> @@ -1923,7 +1923,7 @@ enum vxge_hw_status
__vxge_hw_vpath_alarm_process(
>  	if (vpath == NULL) {
>  		alarm_event = VXGE_HW_SET_LEVEL(VXGE_HW_EVENT_UNKNOWN,
>  			alarm_event);
> -		goto out;
> +		goto out2;
>  	}
> 
>  	hldev = vpath->hldev;
> @@ -2161,7 +2161,7 @@ enum vxge_hw_status
__vxge_hw_vpath_alarm_process(
>  	}
>  out:
>  	hldev->stats.sw_dev_err_stats.vpath_alarms++;
> -
> +out2:
>  	if ((alarm_event == VXGE_HW_EVENT_ALARM_CLEARED) ||
>  		(alarm_event == VXGE_HW_EVENT_UNKNOWN))
>  		return VXGE_HW_OK;
> --
> 1.6.2.3

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - April 24, 2009, 4:38 a.m.
From: "Ramkrishna Vepa" <Ramkrishna.Vepa@neterion.com>
Date: Thu, 23 Apr 2009 22:46:30 -0400

> Good catch! This patch looks good.

Please give an "Acked-by:" or similar for me to add to the
patch.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ramkrishna Vepa - April 24, 2009, 5 a.m.
> Subject: [PATCH] vxge: fix possible NULL dereference in vxge-traffic.c
> 
> If vpath is NULL then hldev is NULL also.
> 
> Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
> ---
>  drivers/net/vxge/vxge-traffic.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/vxge/vxge-traffic.c b/drivers/net/vxge/vxge-
> traffic.c
> index 7be0ae1..506625b 100644
> --- a/drivers/net/vxge/vxge-traffic.c
> +++ b/drivers/net/vxge/vxge-traffic.c
> @@ -1923,7 +1923,7 @@ enum vxge_hw_status
__vxge_hw_vpath_alarm_process(
>  	if (vpath == NULL) {
>  		alarm_event = VXGE_HW_SET_LEVEL(VXGE_HW_EVENT_UNKNOWN,
>  			alarm_event);
> -		goto out;
> +		goto out2;
>  	}
> 
>  	hldev = vpath->hldev;
> @@ -2161,7 +2161,7 @@ enum vxge_hw_status
__vxge_hw_vpath_alarm_process(
>  	}
>  out:
>  	hldev->stats.sw_dev_err_stats.vpath_alarms++;
> -
> +out2:
>  	if ((alarm_event == VXGE_HW_EVENT_ALARM_CLEARED) ||
>  		(alarm_event == VXGE_HW_EVENT_UNKNOWN))
>  		return VXGE_HW_OK;
> --
> 1.6.2.3
Looks good, thanks.

Acked-by: Ram Vepa <ram.vepa@neterion.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - April 27, 2009, 10:03 a.m.
From: "Ramkrishna Vepa" <Ramkrishna.Vepa@neterion.com>
Date: Fri, 24 Apr 2009 01:00:18 -0400

>> Subject: [PATCH] vxge: fix possible NULL dereference in vxge-traffic.c
>> 
>> If vpath is NULL then hldev is NULL also.
>> 
>> Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
 ...
> Looks good, thanks.
> 
> Acked-by: Ram Vepa <ram.vepa@neterion.com>

Applied to net-next-2.6
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/vxge/vxge-traffic.c b/drivers/net/vxge/vxge-traffic.c
index 7be0ae1..506625b 100644
--- a/drivers/net/vxge/vxge-traffic.c
+++ b/drivers/net/vxge/vxge-traffic.c
@@ -1923,7 +1923,7 @@  enum vxge_hw_status __vxge_hw_vpath_alarm_process(
 	if (vpath == NULL) {
 		alarm_event = VXGE_HW_SET_LEVEL(VXGE_HW_EVENT_UNKNOWN,
 			alarm_event);
-		goto out;
+		goto out2;
 	}
 
 	hldev = vpath->hldev;
@@ -2161,7 +2161,7 @@  enum vxge_hw_status __vxge_hw_vpath_alarm_process(
 	}
 out:
 	hldev->stats.sw_dev_err_stats.vpath_alarms++;
-
+out2:
 	if ((alarm_event == VXGE_HW_EVENT_ALARM_CLEARED) ||
 		(alarm_event == VXGE_HW_EVENT_UNKNOWN))
 		return VXGE_HW_OK;