From: Jesper Juhl <jesper.juhl@gmail.com>
To: Petko Manolov <petkan@users.sourceforge.net>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Greg Kroah-Hartman <greg@kroah.com>,
linux-usb-devel@lists.sourceforge.net, netdev@vger.kernel.org,
Jesper Juhl <jesper.juhl@gmail.com>
Subject: [PATCH] USB Pegasus driver - avoid a potential NULL pointer dereference.
Date: Sun, 29 Jul 2007 00:19:02 +0200 [thread overview]
Message-ID: <200707290019.02591.jesper.juhl@gmail.com> (raw)
Hello,
This patch makes sure we don't dereference a NULL pointer in
drivers/net/usb/pegasus.c::write_bulk_callback() in the initial
struct net_device *net = pegasus->net; assignment.
The existing code checks if 'pegasus' is NULL and bails out if
it is, so we better not touch that pointer until after that check.
Please consider merging.
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---
drivers/net/usb/pegasus.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
index a05fd97..04cba6b 100644
--- a/drivers/net/usb/pegasus.c
+++ b/drivers/net/usb/pegasus.c
@@ -768,11 +768,13 @@ done:
static void write_bulk_callback(struct urb *urb)
{
pegasus_t *pegasus = urb->context;
- struct net_device *net = pegasus->net;
+ struct net_device *net;
if (!pegasus)
return;
+ net = pegasus->net;
+
if (!netif_device_present(net) || !netif_running(net))
return;
WARNING: multiple messages have this Message-ID (diff)
From: Jesper Juhl <jesper.juhl@gmail.com>
To: Petko Manolov <petkan@users.sourceforge.net>
Cc: Greg Kroah-Hartman <greg@kroah.com>,
Jesper Juhl <jesper.juhl@gmail.com>,
netdev@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-usb-devel@lists.sourceforge.net
Subject: [PATCH] USB Pegasus driver - avoid a potential NULL pointer dereference.
Date: Sun, 29 Jul 2007 00:19:02 +0200 [thread overview]
Message-ID: <200707290019.02591.jesper.juhl@gmail.com> (raw)
Hello,
This patch makes sure we don't dereference a NULL pointer in
drivers/net/usb/pegasus.c::write_bulk_callback() in the initial
struct net_device *net = pegasus->net; assignment.
The existing code checks if 'pegasus' is NULL and bails out if
it is, so we better not touch that pointer until after that check.
Please consider merging.
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---
drivers/net/usb/pegasus.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
index a05fd97..04cba6b 100644
--- a/drivers/net/usb/pegasus.c
+++ b/drivers/net/usb/pegasus.c
@@ -768,11 +768,13 @@ done:
static void write_bulk_callback(struct urb *urb)
{
pegasus_t *pegasus = urb->context;
- struct net_device *net = pegasus->net;
+ struct net_device *net;
if (!pegasus)
return;
+ net = pegasus->net;
+
if (!netif_device_present(net) || !netif_running(net))
return;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
next reply other threads:[~2007-07-28 22:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-28 22:19 Jesper Juhl [this message]
2007-07-28 22:19 ` [PATCH] USB Pegasus driver - avoid a potential NULL pointer dereference Jesper Juhl
2007-07-28 23:37 ` Satyam Sharma
2007-07-28 23:37 ` Satyam Sharma
2007-07-28 23:55 ` Jesper Juhl
2007-07-28 23:55 ` Jesper Juhl
2007-07-29 8:49 ` [linux-usb-devel] " Oliver Neukum
2007-07-29 18:18 ` Satyam Sharma
2007-07-29 18:18 ` Satyam Sharma
2007-07-30 8:05 ` [linux-usb-devel] " Petko Manolov
2007-07-30 8:05 ` Petko Manolov
2007-07-30 8:54 ` [linux-usb-devel] " Satyam Sharma
2007-07-30 8:54 ` Satyam Sharma
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=200707290019.02591.jesper.juhl@gmail.com \
--to=jesper.juhl@gmail.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
--cc=netdev@vger.kernel.org \
--cc=petkan@users.sourceforge.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.