From: roel kluin <roel.kluin@gmail.com>
To: Paul Walmsley <paul@pwsan.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-omap@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] OMAP: Dereference of NULL autodep in _autodep_lookup()
Date: Wed, 24 Feb 2010 23:24:23 +0100 [thread overview]
Message-ID: <25e057c01002241424s71cc447di4cb93de895cb665b@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1002221357280.2701@utopia.booyaka.com>
> Thanks for the patch, but I don't understand what problem you're
> pointing out. If autodeps is NULL entering clkdm_init(), then the
> for-loop won't even be entered.
My first patch was wrong, but there's something I think could
be wrong. In clkdm_init() we have:
for (autodep = autodeps; autodep->pwrdm.ptr; autodep++)
_autodep_lookup(autodep);
In _autodep_lookup() we ensure that we don't dereference
autodep by:
if (!autodep)
return;
but if autodep can be NULL we already dereferenced it in
the aforementioned for loop, so shouldn't that be:
for (autodep = autodeps; autodep && autodep->pwrdm.ptr; autodep++)
_autodep_lookup(autodep);
Then since this is the only call to _autodep_lookup() we can remove
that test there. Do you agree?
> It looks like there may be a problem, however, in _clkdm_add_autodeps()
> and _clkdm_del_autodeps() if no autodeps were passed in. What do you
> think about something like the following instead?
>
>
> - Paul
Your suggested patch looks right to me as well.
prev parent reply other threads:[~2010-02-24 22:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-14 16:00 Roel Kluin
2010-02-14 16:48 ` Roel Kluin
2010-02-22 21:06 ` Paul Walmsley
2010-02-24 22:24 ` roel kluin [this message]
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=25e057c01002241424s71cc447di4cb93de895cb665b@mail.gmail.com \
--to=roel.kluin@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=paul@pwsan.com \
/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
all inboxes | Powered by JetHome®