提交 9351982b 编写于 作者: M Micah Gruber 提交者: Jeff Garzik

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: NMicah Gruber <micah.gruber@gmail.com>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 80ba80a9
......@@ -768,11 +768,13 @@ static void rx_fixup(unsigned long data)
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册