lkml.org 
[lkml]   [2005]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] isdn_v110 warning fix
On 8/30/05, Alexey Dobriyan <adobriyan@gmail.com> wrote:
> On Tue, Aug 30, 2005 at 01:05:43AM +0200, Jesper Juhl wrote:
> > drivers/isdn/i4l/isdn_v110.c:523: warning: `ret' might be used uninitialized in this function
>
> > --- linux-2.6.13-orig/drivers/isdn/i4l/isdn_v110.c
> > +++ linux-2.6.13/drivers/isdn/i4l/isdn_v110.c
> > @@ -516,11 +516,11 @@
>
> > -isdn_v110_stat_callback(int idx, isdn_ctrl * c)
> > +isdn_v110_stat_callback(int idx, isdn_ctrl *c)
> > {
> > isdn_v110_stream *v = NULL;
> > int i;
> > - int ret;
> > + int ret = 0;
>
> ret is used only in isdn_v110_stat_callback()::case ISDN_STAT_BSENT.
> It's possible for it to be unused only if passed c->parm.length is 0.
> Do you see codepaths that can do it?
>
No, I don't see any codepaths that could lead to it being used uninitialized.
I made the patch for two reasons; 1) To silence the warning, and I
guess it's simply the right thing to do. 2) To make sure the code
behaves in a resonably sane way in case the situation
c->parm.length==0 should somehow happen in the future.

--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-08-30 13:31    [W:0.062 / U:2.124 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site