From: "pin xue" <pinxue@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: a minor bug in via-rhine driver for linux
Date: Tue, 4 Apr 2006 22:39:39 +0800 [thread overview]
Message-ID: <61291d840604040739m69642b26x4b24615112e37ce@mail.gmail.com> (raw)
In-Reply-To: <61291d840604040738k1477cf72w7aadbc1e83d67bba@mail.gmail.com>
Hi:
kernel source version : 2.6.14
file : drivers/net/via-rhine.c
function : alloc_tbufs(), line 1021~1039
problem line : 1035
rp->tx_buf[i] = &rp->tx_bufs[i * PKT_BUF_SZ];
fix: line 1035 should be
if ( rp->quirks & rqRhineI )
rp->tx_buf[i] = &rp->tx_bufs[i * PKT_BUF_SZ];
explaination:
line 718 : here we set rqRhineI flag only for old chips
line 922 : here we allocate buffers and alloc rp->tx_bufs only when
rqRhineI flag setted.
line 1035: here we initialize buffers, but set rp->tx_buf[] based on
tx_bufs anyway.
line 1273: here we use the buffers and refer rp->tx_buf[] only when
rqRhineI flag setted.
Currently, line 1035 does not cause any invalid memory accessing but
calculating and saving some invalid memory address.
comments:
I'm reading this driver and line 1035 confused me for a moment.
--
Best Regards!
Yang Wu
Mobile Phone: +86-013636674084
WorldWideWeb: http://www.pinxue.net
--
Best Regards!
Yang Wu
Mobile Phone: +86-013636674084
WorldWideWeb: http://www.pinxue.net
next parent reply other threads:[~2006-04-04 14:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <61291d840604040738k1477cf72w7aadbc1e83d67bba@mail.gmail.com>
2006-04-04 14:39 ` pin xue [this message]
2006-04-04 18:49 ` [PATCH] via-rhine: execute bounce buffers code on Rhine-I only Roger Luethi
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=61291d840604040739m69642b26x4b24615112e37ce@mail.gmail.com \
--to=pinxue@gmail.com \
--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
Powered by JetHome