RE: [patch] [SCSI] scsi_dh: potential null dereference in scsi_dh_activate()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: James Bottomley [mailto:James.Bottomley@xxxxxxx]
> Sent: Tuesday, January 04, 2011 10:25 AM
> To: Moger, Babu
> Cc: Dan Carpenter; Mike Snitzer; Menny Hamburger; linux-
> scsi@xxxxxxxxxxxxxxx; kernel-janitors@xxxxxxxxxxxxxxx
> Subject: RE: [patch] [SCSI] scsi_dh: potential null dereference in
> scsi_dh_activate()
> 
> On Tue, 2011-01-04 at 09:13 -0700, Moger, Babu wrote:
> > Looks good to me.
> 
> It does?  The first check is the bogus one, surely.  The queue is
> created and destroyed by scsi_alloc_sdev(), so queuedata can never be
> NULL for a SCSI queue.  There's no check anywhere in the rest of SCSI,
> so there shouldn't be one here, should there?

You are right. This check may not be required.

But I am not sure why there is a check in scsi_device_from_queue. 
Is there a possibility of request_fn other than scsi_request_fn for scsi device?  I donât know.  Here is the code..

struct scsi_device *scsi_device_from_queue(struct request_queue *q)
{
        struct scsi_device *sdev = NULL;

        if (q->request_fn == scsi_request_fn)
                sdev = q->queuedata;

        return sdev;
}
 
ÿô.nlj·Ÿ®‰­†+%ŠË±é¥Šwÿº{.nlj·¥Š{±þÇ‹ø¡Ü}©ž²ÆzÚj:+v‰¨þø®w¥þŠàÞ¨è&¢)ß«a¶Úÿûz¹ÞúŽŠÝjÿŠwèf



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux