From: Thomas Jarosch <thomas.jarosch@intra2net.com>
To: netdev@vger.kernel.org
Subject: cassini driver: Use of uninitialized memory
Date: Thu, 25 Aug 2011 15:58:45 +0200 [thread overview]
Message-ID: <201108251558.45290.thomas.jarosch@intra2net.com> (raw)
Hello,
the interrupt routine of the cassini driver
currently looks like this:
----------------------
static irqreturn_t cas_interruptN(int irq, void *dev_id)
{
struct net_device *dev = dev_id;
struct cas *cp = netdev_priv(dev);
unsigned long flags;
int ring;
u32 status = readl(cp->regs + REG_PLUS_INTRN_STATUS(ring));
...
----------------------
-> "ring" isn't initialized properly and gets used
in REG_PLUS_INTRN_STATUS. Some lines below there's this:
----------------------
ring = (irq == cp->pci_irq_INTC) ? 2 : 3;
----------------------
Should that line be moved before the readl() call
or should "ring" be initialized with zero?
Credit for spotting this goes to cppcheck.
Cheers,
Thomas
next reply other threads:[~2011-08-25 14:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-25 13:58 Thomas Jarosch [this message]
2011-08-25 15:02 ` [PATCH] cassini: init before use in cas_interruptN Francois Romieu
2011-08-26 16:52 ` 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=201108251558.45290.thomas.jarosch@intra2net.com \
--to=thomas.jarosch@intra2net.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