Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff83efac authored by James Bottomley's avatar James Bottomley
Browse files

[SCSI] gdth: don't call pci_free_consistent under spinlock



The spinlock is held over too large a region: pscratch is a permanent
address (it's allocated at boot time and never changes).  All you need
the smp lock for is mediating the scratch in use flag, so fix this by
moving the spinlock into the case where we set the pscratch_busy flag
to false.

Cc: Stable Tree <stable@kernel.org>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 279e7f54
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -694,15 +694,13 @@ static void gdth_ioctl_free(gdth_ha_str *ha, int size, char *buf, ulong64 paddr)
{
{
    ulong flags;
    ulong flags;


    spin_lock_irqsave(&ha->smp_lock, flags);

    if (buf == ha->pscratch) {
    if (buf == ha->pscratch) {
	spin_lock_irqsave(&ha->smp_lock, flags);
        ha->scratch_busy = FALSE;
        ha->scratch_busy = FALSE;
	spin_unlock_irqrestore(&ha->smp_lock, flags);
    } else {
    } else {
        pci_free_consistent(ha->pdev, size, buf, paddr);
        pci_free_consistent(ha->pdev, size, buf, paddr);
    }
    }

    spin_unlock_irqrestore(&ha->smp_lock, flags);
}
}


#ifdef GDTH_IOCTL_PROC
#ifdef GDTH_IOCTL_PROC