netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netdev: enc28j60 kernel panic fix.
@ 2016-05-04 17:51 David Russell
  2016-05-05  8:51 ` Francois Romieu
  0 siblings, 1 reply; 5+ messages in thread
From: David Russell @ 2016-05-04 17:51 UTC (permalink / raw)
  To: netdev

When connected directly to another system (not via a switch)
eventually a condition where a NULL pointer dereference occurs in
enc28j60_hw_tx() and this patch simply checks for that condition and
returns gracefully without causing a kernel panic.  I believe, but
have not investigated this is caused by a packet collision and am not
sure if the kernel tracks collisions or counts them as errors, so that
should probably be added if this is what's happening.  I'm also not
familiar with the linux kernel, so may have fixed this in a less than
ideal way.

Developer's Certificate of Origin 1.1

        By making a contribution to this project, I certify that:

        (d) I understand and agree that this project and the contribution
            are public and that a record of the contribution (including all
            personal information I submit with it, including my sign-off) is
            maintained indefinitely and may be redistributed consistent with
            this project or the open source license(s) involved.

Signed-off-by: David Russell <david@aprsworld.com>

---
diff --git a/drivers/net/ethernet/microchip/enc28j60.c
b/drivers/net/ethernet/microchip/enc28j60.c
index 86ea17e..36ac65f 100644
--- a/drivers/net/ethernet/microchip/enc28j60.c
+++ b/drivers/net/ethernet/microchip/enc28j60.c
@@ -1233,6 +1233,9 @@ static void enc28j60_irq_work_handler(struct
work_struct *work)
  */
 static void enc28j60_hw_tx(struct enc28j60_net *priv)
 {
+       if (!priv->tx_skb)
+               return;
+
        if (netif_msg_tx_queued(priv))
                printk(KERN_DEBUG DRV_NAME
                        ": Tx Packet Len:%d\n", priv->tx_skb->len);

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-09 16:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-04 17:51 [PATCH] netdev: enc28j60 kernel panic fix David Russell
2016-05-05  8:51 ` Francois Romieu
2016-05-06 18:26   ` David Russell
2016-05-06 20:35     ` Francois Romieu
2016-05-09 16:59       ` David Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).