User: | Jiri Slaby |
Error type: | Invalid Pointer Dereference |
Error type description: | A pointer which is invalid is being dereferenced |
File location: | drivers/ata/libata-core.c |
Line in file: | 5790 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Smatch
(1.59)
|
Entered: | 2013-09-11 08:47:26 UTC |
5760 * 5761 * LOCKING: 5762 * Inherited from calling layer (may sleep). 5763 * 5764 * RETURNS: 5765 * 0 if all ports are started successfully, -errno otherwise. 5766 */ 5767int ata_host_start(struct ata_host *host) 5768{ 5769 int have_stop = 0; 5770 void *start_dr = NULL; 5771 int i, rc; 5772 5773 if (host->flags & ATA_HOST_STARTED) 5774 return 0; 5775 5776 ata_finalize_port_ops(host->ops); 5777 5778 for (i = 0; i < host->n_ports; i++) { 5779 struct ata_port *ap = host->ports[i]; 5780 5781 ata_finalize_port_ops(ap->ops); 5782 5783 if (!host->ops && !ata_port_is_dummy(ap)) 5784 host->ops = ap->ops; 5785 5786 if (ap->ops->port_stop) 5787 have_stop = 1; 5788 } 5789 5790 if (host->ops->host_stop) 5791 have_stop = 1; 5792 5793 if (have_stop) { 5794 start_dr = devres_alloc(ata_host_stop, 0, GFP_KERNEL); 5795 if (!start_dr) 5796 return -ENOMEM; 5797 } 5798 5799 for (i = 0; i < host->n_ports; i++) { 5800 struct ata_port *ap = host->ports[i];