From: Kumar Amit Mehta <gmate.amit@gmail.com>
To: jdmason@kudzu.us
Cc: davem@davemloft.net, joe@perches.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] ethernet: neterion: vxge: vxge-traffic.c: fix for a potential NULL pointer dereference
Date: Sat, 16 Feb 2013 09:56:34 -0800 [thread overview]
Message-ID: <1361037394-14731-1-git-send-email-gmate.amit@gmail.com> (raw)
fix for a potential NULL pointer dereference and removal of a redundant
assignment operation. Found using smatch.
Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
---
drivers/net/ethernet/neterion/vxge/vxge-traffic.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-traffic.c b/drivers/net/ethernet/neterion/vxge/vxge-traffic.c
index 99749bd..adb05a8 100644
--- a/drivers/net/ethernet/neterion/vxge/vxge-traffic.c
+++ b/drivers/net/ethernet/neterion/vxge/vxge-traffic.c
@@ -611,11 +611,8 @@ __vxge_hw_vpath_alarm_process(struct __vxge_hw_virtualpath *vpath,
struct vxge_hw_vpath_stats_sw_info *sw_stats;
struct vxge_hw_vpath_reg __iomem *vp_reg;
- if (vpath == NULL) {
- alarm_event = VXGE_HW_SET_LEVEL(VXGE_HW_EVENT_UNKNOWN,
- alarm_event);
+ if (vpath == NULL)
goto out2;
- }
hldev = vpath->hldev;
vp_reg = vpath->vp_reg;
@@ -852,13 +849,12 @@ __vxge_hw_vpath_alarm_process(struct __vxge_hw_virtualpath *vpath,
}
out:
hldev->stats.sw_dev_err_stats.vpath_alarms++;
+ __vxge_hw_device_handle_error(hldev, vpath->vp_id, alarm_event);
out2:
if ((alarm_event == VXGE_HW_EVENT_ALARM_CLEARED) ||
(alarm_event == VXGE_HW_EVENT_UNKNOWN))
return VXGE_HW_OK;
- __vxge_hw_device_handle_error(hldev, vpath->vp_id, alarm_event);
-
if (alarm_event == VXGE_HW_EVENT_SERR)
return VXGE_HW_ERR_CRITICAL;
--
1.7.9.5
next reply other threads:[~2013-02-16 17:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-16 17:56 Kumar Amit Mehta [this message]
2013-02-17 14:49 ` [PATCH] ethernet: neterion: vxge: vxge-traffic.c: fix for a potential NULL pointer dereference walter harms
2013-02-18 19:45 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1361037394-14731-1-git-send-email-gmate.amit@gmail.com \
--to=gmate.amit@gmail.com \
--cc=davem@davemloft.net \
--cc=jdmason@kudzu.us \
--cc=joe@perches.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).