Fix a potential NULL pointer dereference in write_bulk_callback() in drivers/net/usb/pegasus.c
This patch fixes a potential null dereference bug where we dereference pegasus before a null check. This patch simply moves the dereferencing after the null check. Signed-off-by: Micah Gruber <micah.gruber@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
parent
80ba80a9bf
commit
9351982b25
1 changed files with 3 additions and 1 deletions
|
@ -768,11 +768,13 @@ done:
|
||||||
static void write_bulk_callback(struct urb *urb)
|
static void write_bulk_callback(struct urb *urb)
|
||||||
{
|
{
|
||||||
pegasus_t *pegasus = urb->context;
|
pegasus_t *pegasus = urb->context;
|
||||||
struct net_device *net = pegasus->net;
|
struct net_device *net;
|
||||||
|
|
||||||
if (!pegasus)
|
if (!pegasus)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
net = pegasus->net;
|
||||||
|
|
||||||
if (!netif_device_present(net) || !netif_running(net))
|
if (!netif_device_present(net) || !netif_running(net))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue