Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9351982b authored by Micah Gruber's avatar Micah Gruber Committed by Jeff Garzik
Browse files

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: default avatarMicah Gruber <micah.gruber@gmail.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 80ba80a9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;