re: ncr5380: Implement new eh_bus_reset_handler

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

 



Hello Finn Thain,

The patch 62717f537e1b: "ncr5380: Implement new eh_bus_reset_handler"
from Jan 3, 2016, leads to the following static checker warning:

	drivers/scsi/NCR5380.c:2476 NCR5380_bus_reset()
	error: potential NULL dereference 'hostdata->connected'.

drivers/scsi/NCR5380.c
  2468  
  2469          if (hostdata->connected) {
                    ^^^^^^^^^^^^^^^^^^^
  2470                  set_host_byte(hostdata->connected, DID_RESET);
  2471                  complete_cmd(instance, hostdata->connected);
  2472                  hostdata->connected = NULL;
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
->connected is NULL because it either starts as NULL or we set it to
NULL.

  2473          }
  2474  
  2475          if (hostdata->sensing) {
  2476                  set_host_byte(hostdata->connected, DID_RESET);
                                      ^^^^^^^^^^^^^^^^^^^
It leads to a NULL dereference here.

  2477                  complete_cmd(instance, hostdata->sensing);
  2478                  hostdata->sensing = NULL;
  2479          }
  2480  
  2481          for (i = 0; i < 8; ++i)
  2482                  hostdata->busy[i] = 0;

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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