aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/visorhba
diff options
context:
space:
mode:
authorSameer Wadgaonkar <sameer.wadgaonkar@unisys.com>2017-04-18 16:55:25 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-28 11:55:53 +0200
commit3c2bf0bd08123f3497bd3e84bd9088c937b0cb40 (patch)
tree8e0594893e9d9382ea7ffb550d61b5716eb6305b /drivers/staging/unisys/visorhba
parentstaging: unisys: visorbus: fix s-Par to boot with option CONFIG_VMAP_STACK set to y (diff)
downloadlinux-dev-3c2bf0bd08123f3497bd3e84bd9088c937b0cb40.tar.xz
linux-dev-3c2bf0bd08123f3497bd3e84bd9088c937b0cb40.zip
staging: unisys: visorhba: fix s-Par to boot with option CONFIG_VMAP_STACK set to y
The root issue is that we are not allowed to have items on the stack being passed to "DMA" like operations. In this case we have a vmcall and an inline completion of scsi command. This patch fixes the issue by moving the variables on stack in do_scsi_nolinuxstat() to heap memory. Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/unisys/visorhba')
-rw-r--r--drivers/staging/unisys/visorhba/visorhba_main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c
index d3721158fc7f..6997b16b4dcd 100644
--- a/drivers/staging/unisys/visorhba/visorhba_main.c
+++ b/drivers/staging/unisys/visorhba/visorhba_main.c
@@ -839,7 +839,7 @@ static void
do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd)
{
struct scsi_device *scsidev;
- unsigned char buf[36];
+ unsigned char *buf;
struct scatterlist *sg;
unsigned int i;
char *this_page;
@@ -854,6 +854,10 @@ do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd)
if (cmdrsp->scsi.no_disk_result == 0)
return;
+ buf = kzalloc(sizeof(char) * 36, GFP_KERNEL);
+ if (!buf)
+ return;
+
/* Linux scsi code wants a device at Lun 0
* to issue report luns, but we don't want
* a disk there so we'll present a processor
@@ -865,6 +869,7 @@ do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd)
if (scsi_sg_count(scsicmd) == 0) {
memcpy(scsi_sglist(scsicmd), buf,
cmdrsp->scsi.bufflen);
+ kfree(buf);
return;
}
@@ -876,6 +881,7 @@ do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd)
memcpy(this_page, buf + bufind, sg[i].length);
kunmap_atomic(this_page_orig);
}
+ kfree(buf);
} else {
devdata = (struct visorhba_devdata *)scsidev->host->hostdata;
for_each_vdisk_match(vdisk, devdata, scsidev) {