linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Hans J. Koch" <hjk@hansjkoch.de>
Cc: Vitalii Demianets <vitas@nppfactor.kiev.ua>,
	Tux9 <tuxding@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized
Date: Fri, 30 Nov 2012 15:43:31 -0800	[thread overview]
Message-ID: <20121130234331.GD17353@kroah.com> (raw)
In-Reply-To: <20121130213906.GB2603@local>

On Fri, Nov 30, 2012 at 10:39:06PM +0100, Hans J. Koch wrote:
> On Fri, Nov 30, 2012 at 01:16:19PM +0200, Vitalii Demianets wrote:
> > On Friday 30 November 2012 01:58:22 Hans J. Koch wrote:
> > > On Thu, Nov 29, 2012 at 06:36:59PM +0200, Vitalii Demianets wrote:
> > > > > On Thursday 29 November 2012 18:05:27 Tux9 wrote:
> > > > > > Hans, I think there are something wrong in your patch, while
> > > > > > Vitalii's is right. The variable "ret" is reused in line 292 and line
> > > > > > 295, so the value of "ret" would be overridden (if it goto err_map in
> > > > > > line 284 when mi>=1).
> > > > >
> > > > > Actually, both patches do exactly the same thing. Hans's patch
> > > > > establishes default value for the ret for all those "other" cases when
> > > > > ret is not explicitly overridden. My patch explicitly enumerates all
> > > > > those "other" cases in more wordily manner.
> > > >
> > > > Oops, disregard this. After looking at it more thoroughly I got your
> > > > point. You are right, ret is overridden at first iteration (mi == 0), so
> > > > Hans's approach does not work.
> > > > I must do more thinking before replying in a hurry.
> > >
> > > You're right. Initialization of "ret" has to take place at the beginning of
> > > the loop.
> > >
> > > I think this version is right:
> > 
> > Yes, this looks right for me.
> 
> OK, I'll send that patch offically, then. This might also be material for
> the stable updates. Greg?

Yes, that sounds good.

greg k-h

  reply	other threads:[~2012-11-30 23:43 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-27 11:48 [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized Vitalii Demianets
2012-11-27 12:24 ` Vitalii Demianets
2012-11-27 22:43 ` Hans J. Koch
2012-11-28  8:58   ` Vitalii Demianets
2012-11-28 21:05     ` Hans J. Koch
2012-11-29 16:05       ` Tux9
2012-11-29 16:22         ` Vitalii Demianets
2012-11-29 16:33           ` Cong Ding
2012-11-29 16:36           ` Vitalii Demianets
2012-11-29 23:58             ` Hans J. Koch
2012-11-30 11:12               ` Tux9
2012-11-30 21:33                 ` Hans J. Koch
2012-12-01  1:22                   ` Cong Ding
2012-12-01  3:56                     ` Hans J. Koch
2012-12-01  9:58                       ` Cong Ding
2012-12-03  7:51                         ` Hans J. Koch
2012-11-30 11:16               ` Vitalii Demianets
2012-11-30 21:39                 ` Hans J. Koch
2012-11-30 23:43                   ` Greg Kroah-Hartman [this message]
2012-12-03  7:41                     ` [PATCH] stable: uio: " Hans J. Koch
2012-12-03 13:38                       ` Ben Hutchings
2012-12-03  8:35                   ` [PATCH] uio.c: " Vitalii Demianets
2012-12-03  8:53                     ` Vitalii Demianets
2012-12-03 17:27                       ` Hans J. Koch

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=20121130234331.GD17353@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=hjk@hansjkoch.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tuxding@gmail.com \
    --cc=vitas@nppfactor.kiev.ua \
    /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;
as well as URLs for NNTP newsgroup(s).