mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drivers/net: ks8842 Fix crash on received packet when in PIO mode.
@ 2011-05-18 21:51 Dennis Aberilla
  2011-05-18 22:03 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Dennis Aberilla @ 2011-05-18 21:51 UTC (permalink / raw)
  To: info; +Cc: davem, linux-kernel


This patch fixes a kernel crash during packet reception due to not enough allocated bytes for the skb. This applies to the driver when running in PIO mode in an ISA bus setup.

Signed-off-by: Dennis Aberilla <denzzzhome@yahoo.com>


---
diff --git a/drivers/net/ks8842.c b/drivers/net/ks8842.c
index f0d8346..9069aee 100644
--- a/drivers/net/ks8842.c
+++ b/drivers/net/ks8842.c
@@ -662,7 +662,7 @@ static void ks8842_rx_frame(struct net_device *netdev,

   /* check the status */
   if ((status & RXSR_VALID) && !(status & RXSR_ERROR)) {
-     struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len);
+     struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len + 2);

      if (skb) {



--

|Dennis

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

* Re: [PATCH] drivers/net: ks8842 Fix crash on received packet when in PIO mode.
  2011-05-18 21:51 [PATCH] drivers/net: ks8842 Fix crash on received packet when in PIO mode Dennis Aberilla
@ 2011-05-18 22:03 ` David Miller
  2011-05-18 22:03   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2011-05-18 22:03 UTC (permalink / raw)
  To: denzzzhome; +Cc: info, linux-kernel

From: Dennis Aberilla <denzzzhome@yahoo.com>
Date: Wed, 18 May 2011 14:51:14 -0700 (PDT)

> diff --git a/drivers/net/ks8842.c b/drivers/net/ks8842.c
> index f0d8346..9069aee 100644
> --- a/drivers/net/ks8842.c
> +++ b/drivers/net/ks8842.c
> @@ -662,7 +662,7 @@ static void ks8842_rx_frame(struct net_device *netdev,
> 
>    /* check the status */
>    if ((status & RXSR_VALID) && !(status & RXSR_ERROR)) {
> -     struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len);
> +     struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len + 2);

Your patch has been corrupted by your email client, it has turned TAB
characters into spaces, amongst other things.  This makes your patch
unusable.

Please read Documentation/email-clients.txt, and use that information
to fix your email client, and then send the patch as a test email
to yourself and make sure that you can extract the patch and apply
it cleanly before you resend it here.

Thanks.

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

* Re: [PATCH] drivers/net: ks8842 Fix crash on received packet when in PIO mode.
  2011-05-18 22:03 ` David Miller
@ 2011-05-18 22:03   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2011-05-18 22:03 UTC (permalink / raw)
  To: denzzzhome; +Cc: info, linux-kernel


BTW, you also sent this to the wrong list.

Networking patches must be sent to netdev@vger.kernel.org

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

end of thread, other threads:[~2011-05-18 22:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-18 21:51 [PATCH] drivers/net: ks8842 Fix crash on received packet when in PIO mode Dennis Aberilla
2011-05-18 22:03 ` David Miller
2011-05-18 22:03   ` David Miller

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®