summaryrefslogtreecommitdiff
path: root/drivers/scsi/gdth.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-12-12 08:41:20 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2019-01-08 21:57:42 -0500
commit463563fa745ac7ac564458c1903325b937ee8c5f (patch)
tree458917b2f6ad4ca44e87f30b83220815f2ba65cb /drivers/scsi/gdth.c
parent8d22022c3a56314b182810794cae47686b765313 (diff)
scsi: gdth: remove gdth_{alloc,free}_ioctl
Out of the three callers once insists on the scratch buffer, and the others are fine with a new allocation. Switch those two to just use pci_alloc_consistent directly, and open code the scratch buffer allocation in the remaining one. This avoids a case where we might be doing a memory allocation under a spinlock with irqs disabled. [mkp: typo] Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/gdth.c')
-rw-r--r--drivers/scsi/gdth.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index dd6784e03a57..87786e8fdf14 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -4239,7 +4239,7 @@ static int ioc_general(void __user *arg, char *cmnd)
gdth_ioctl_general gen;
gdth_ha_str *ha;
char *buf = NULL;
- u64 paddr;
+ dma_addr_t paddr;
int rval;
if (copy_from_user(&gen, arg, sizeof(gdth_ioctl_general)))
@@ -4256,8 +4256,8 @@ static int ioc_general(void __user *arg, char *cmnd)
return -EINVAL;
if (gen.data_len + gen.sense_len > 0) {
- buf = gdth_ioctl_alloc(ha, gen.data_len + gen.sense_len, FALSE,
- &paddr);
+ buf = pci_alloc_consistent(ha->pdev,
+ gen.data_len + gen.sense_len, &paddr);
if (!buf)
return -EFAULT;
@@ -4292,7 +4292,7 @@ static int ioc_general(void __user *arg, char *cmnd)
rval = 0;
out_free_buf:
- gdth_ioctl_free(ha, gen.data_len+gen.sense_len, buf, paddr);
+ pci_free_consistent(ha->pdev, gen.data_len + gen.sense_len, buf, paddr);
return rval;
}