Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
"Two small changes, one in the lpfc driver and the other in the core.

The core change is an additional footgun guard which prevents users
from writing the wrong state to sysfs and causing a hang"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: lpfc: Fix memory leak in lpfc_create_port()
scsi: core: Restrict legal sdev_state transitions via sysfs

+12 -3
+4 -3
drivers/scsi/lpfc/lpfc_init.c
··· 4812 4812 rc = lpfc_vmid_res_alloc(phba, vport); 4813 4813 4814 4814 if (rc) 4815 - goto out; 4815 + goto out_put_shost; 4816 4816 4817 4817 /* Initialize all internally managed lists. */ 4818 4818 INIT_LIST_HEAD(&vport->fc_nodes); ··· 4830 4830 4831 4831 error = scsi_add_host_with_dma(shost, dev, &phba->pcidev->dev); 4832 4832 if (error) 4833 - goto out_put_shost; 4833 + goto out_free_vmid; 4834 4834 4835 4835 spin_lock_irq(&phba->port_list_lock); 4836 4836 list_add_tail(&vport->listentry, &phba->port_list); 4837 4837 spin_unlock_irq(&phba->port_list_lock); 4838 4838 return vport; 4839 4839 4840 - out_put_shost: 4840 + out_free_vmid: 4841 4841 kfree(vport->vmid); 4842 4842 bitmap_free(vport->vmid_priority_range); 4843 + out_put_shost: 4843 4844 scsi_host_put(shost); 4844 4845 out: 4845 4846 return NULL;
+8
drivers/scsi/scsi_sysfs.c
··· 828 828 } 829 829 830 830 mutex_lock(&sdev->state_mutex); 831 + switch (sdev->sdev_state) { 832 + case SDEV_RUNNING: 833 + case SDEV_OFFLINE: 834 + break; 835 + default: 836 + mutex_unlock(&sdev->state_mutex); 837 + return -EINVAL; 838 + } 831 839 if (sdev->sdev_state == SDEV_RUNNING && state == SDEV_RUNNING) { 832 840 ret = 0; 833 841 } else {