mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matt Mackall <mpm@selenic.com>
To: linux-kernel <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>
Subject: [PATCH] Fix netpoll cleanup on abort without dev
Date: Wed, 4 Aug 2004 09:20:49 -0500	[thread overview]
Message-ID: <20040804142049.GL16310@waste.org> (raw)

If netpoll attempts to use a device without polling support, it will
oops when shutting down. This adds a check that we've actually
attached to a device.

Signed-off-by: Matt Mackall <mpm@selenic.com>

Index: np/net/core/netpoll.c
===================================================================
--- np.orig/net/core/netpoll.c	2004-08-04 08:50:56.000000000 -0500
+++ np/net/core/netpoll.c	2004-08-04 09:02:50.000000000 -0500
@@ -614,7 +614,8 @@
 		spin_lock_irqsave(&rx_list_lock, flags);
 		list_del(&np->rx_list);
 #ifdef CONFIG_NETPOLL_RX
-		np->dev->netpoll_rx = 0;
+		if (np->dev)
+			np->dev->netpoll_rx = 0;
 #endif
 		spin_unlock_irqrestore(&rx_list_lock, flags);
 	}


-- 
Mathematics is the supreme nostalgia of our time.

             reply	other threads:[~2004-08-04 14:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-04 14:20 Matt Mackall [this message]
2004-08-04 14:54 ` Jeff Moyer
2004-08-04 15:11   ` Matt Mackall

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=20040804142049.GL16310@waste.org \
    --to=mpm@selenic.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®