Re: [PATCH v3 6/7] libsas: add wait-complete support to sync discovery event

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

 



On 10/07/2017 08:06, Yijing Wang wrote:

 static void sas_chain_event(int event, unsigned long *pending,
@@ -592,9 +596,9 @@ int sas_discover_event(struct asd_sas_port *port, enum discover_event ev)
 {
 	struct sas_discovery *disc;

+	disc = &port->disc;
 	if (!port)
 		return 0;
-	disc = &port->disc;

 	BUG_ON(ev >= DISC_NUM_EVENTS);

diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index 570b2cb..9d26c28 1

I was just looking through the code and I noticed this, above. Is there a specific reason to move the NULL check, or was it modified accidentally?

I mean, if port is NULL I don't think we would get as far as checking it as we would have already de-referenced it.





[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