From: Dennis Aberilla <dennis.aberilla@mimomax.com>
To: info@mocean-labs.com
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH] drivers/net: ks8842 Fix crash on received packet when in PIO mode.
Date: Thu, 19 May 2011 10:59:47 +1200 [thread overview]
Message-ID: <20110518225945.GB6416@dens-work> (raw)
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) {
--
Using mutt this time.
|Dennis
=======================================================================
This email, including any attachments, is only for the intended
addressee. It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
altered or corrupted during transmission.
=======================================================================
next reply other threads:[~2011-05-18 22:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-18 22:59 Dennis Aberilla [this message]
2011-05-19 20:12 ` [PATCH] drivers/net: ks8842 Fix crash on received packet when in PIO mode David Miller
2011-05-19 23:30 ` Dennis Aberilla
-- strict thread matches above, loose matches on Subject: below --
2011-05-29 21:46 Dennis Aberilla
2011-05-31 22:15 ` David Miller
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=20110518225945.GB6416@dens-work \
--to=dennis.aberilla@mimomax.com \
--cc=davem@davemloft.net \
--cc=info@mocean-labs.com \
--cc=netdev@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