Re: [patch] libsas: dereferencing variable before check

From: Dan Carpenter
Date: Thu May 13 2010 - 14:43:17 EST


On Thu, May 13, 2010 at 09:31:54AM -0500, James Bottomley wrote:
> On Thu, 2010-05-13 at 01:08 +0200, Tejun Heo wrote:
> >
> > "Dan Carpenter" <error27@xxxxxxxxx> wrote:
> >
> > >The "qc->scsicmd" could be null so I moved the dereference inside the
> > >check. This was introduced by 70b25f890: "[SCSI] fix locking around
> > >blk_abort_request()"
> > >
> > >Signed-off-by: Dan Carpenter <error27@xxxxxxxxx>
> >
> > Ooh.. right.
> >
> > Asked-by: Tejun Heo <tj@xxxxxxxxxx>
>
> Well, oops, yes. Two patches to fix one bug is a bit overboard, I
> think, plus some code rearrangement to fix the locality of the problem
> and ensure it doesn't happen again might be useful. What about this.
>

Looks good.

Acked-by: Dan Carpenter <error27@xxxxxxxxx>

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/