From: Greg KH <gregkh@suse.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] Removes warning related to use of uninitialized
Date: Thu, 13 Jan 2011 18:29:35 +0000 [thread overview]
Message-ID: <20110113182935.GA31570@suse.de> (raw)
In-Reply-To: <AANLkTi=h20J0XhFp2=iGH0WF-uZmWS0cv4018X=h5YBn@mail.gmail.com>
On Wed, Jan 12, 2011 at 08:05:10PM -0800, Sukanto Ghosh wrote:
> > If you just set it to NULL, how could it ever not be NULL, so why add
> > this check?
> >
> Because, there is an assignment to i inside the for-each loop (hlist_for_each)
> if it enters the loop.
Which it always will do, right? So there isn't a problem.
> > Also, no, this isn't correct, i is used in the hlist traversal.
> >
> Indeed it is being used but what if it doesn't enters the loop i.e. if
> h->first is NULL
Can that ever happen?
> It is a different issue whether (h->first != NULL) is a precondition
> to this function
I think it is as it works fine today :)
> but the compiler is warning because there exists a path to access of i->head
> where it might be left uninitialized.
But again, that can never happen, right?
thanks,
greg k-h
next prev parent reply other threads:[~2011-01-13 18:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-13 2:26 [PATCH] Removes warning related to use of uninitialized variable i Sukanto Ghosh
2011-01-13 3:05 ` [PATCH] Removes warning related to use of uninitialized Greg KH
2011-01-13 4:05 ` [PATCH] Removes warning related to use of uninitialized variable i Sukanto Ghosh
2011-01-13 5:22 ` [PATCH] Removes warning related to use of uninitialized Dan Carpenter
2011-01-13 6:49 ` [PATCH] Removes warning related to use of uninitialized variable i Sukanto Ghosh
2011-01-13 8:21 ` [PATCH] Removes warning related to use of uninitialized variable walter harms
2011-01-13 18:29 ` Greg KH [this message]
2011-01-13 19:38 ` [PATCH] Removes warning related to use of uninitialized variable i Sukanto Ghosh
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=20110113182935.GA31570@suse.de \
--to=gregkh@suse.de \
--cc=kernel-janitors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.