Re: [CHECKER] null bugs in 2.4.4 and 2.4.4-ac8

Willem Riede (wriede@home.com)
Thu, 24 May 2001 20:00:58 -0400


Junfeng Yang wrote:
>
> On Thu, 24 May 2001, Willem Riede wrote:
>
> > Dawson Engler wrote:
> > >
> > > Hi All,
> > >
> > > Enclosed are 103 potential errors where code gets a pointer from a
> > > possibly-failing routine (kmalloc, etc) and dereferences it without
> > >
> > > [BUG] osst_do_scsi will never return NULL if argument SRpnt isn't NULL. But they copy SRpnt back by *aSRpnt, implies it could be NULL
> >
> > No. It implies SRpnt could have changed. The functions flagged
> > (osst_read_back_buffer_and_rewrite and osst_reposition_and_retry)
> > cannot be reached with SRpnt == NULL. So these are false alarms.
>
> these are false positives if osst_read_back_buffer_and rewrite can't be
> reached with SRpnt == NULL. It seems that osst_do_scsi will not change
> SRpnt unless it is NULL though.

That is currently true, and the re-assignment of SRpnt is superfluous but
harmless. It is not a design constraint though that SRpnt cannot change
(except it can't change to NULL), so I prefer to leave the code as is.

> In other words, SRpnt is changed by
> osst_do_scsi <=> the initial argument SRpnt == NULL. Probabaly the pointer
> aSRpnt is useless.
>
The pointer aSRpnt is not useless, it's used to communicate the current
value of SRpnt throughout the driver.

Regards, Willem Riede.
-
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/