Re: Encountered a Null Pointer Problem on the SCSI Layer

From: Pete Zaitcev (zaitcev@redhat.com)
Date: Mon Jan 28 2002 - 19:05:51 EST


> From: Jesper Juhl <jju@dif.dk>
> Date: Tue, 29 Jan 2002 00:57:02 +0100

> > - if (!dpnt)
> > + if (!dpnt->device)
> > return NULL; /* No such device */
>
> Maybe I don't understand this right, but shouldn't that be
>
> if (!dpnt || !dpnt->device)
> return NULL; /* No such device */

In both cases, the code is like this:

  dpnt = &rscsi_disks[dev_nr];
  if (!dpnt->device)
    return NULL;

So, it is unlikely that dpnt would be zero. It could be if rscsi_disks
were NULL, and in such case whole logics is toast.

-- Pete
-
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/



This archive was generated by hypermail 2b29 : Thu Jan 31 2002 - 21:00:56 EST