]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
aacraid: IOCTL pass-through command fix
authorMahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Thu, 26 Mar 2015 14:41:23 +0000 (10:41 -0400)
committerJames Bottomley <JBottomley@Odin.com>
Thu, 9 Apr 2015 23:44:49 +0000 (16:44 -0700)
The Linux aacriad driver fails to detect the case of SG list count=0 on IOCTL
pass-through command and cause intermittent fault.  The result is the Linux
aacriad driver send down IOCTL pass-through command with one not initialized
SG list to firmware when receiving SG list count =0 on pass-through command.

Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
drivers/scsi/aacraid/commctrl.c

index fbcd48d0bfc3397f2a5b202b093d06bbaa2420a6..54195a117f72e1f29241b1d079eb8de96e0df056 100644 (file)
@@ -689,7 +689,10 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
                        kfree (usg);
                }
                srbcmd->count = cpu_to_le32(byte_count);
-               psg->count = cpu_to_le32(sg_indx+1);
+               if (user_srbcmd->sg.count)
+                       psg->count = cpu_to_le32(sg_indx+1);
+               else
+                       psg->count = 0;
                status = aac_fib_send(ScsiPortCommand64, srbfib, actual_fibsize, FsaNormal, 1, 1,NULL,NULL);
        } else {
                struct user_sgmap* upsg = &user_srbcmd->sg;
@@ -775,7 +778,10 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
                        }
                }
                srbcmd->count = cpu_to_le32(byte_count);
-               psg->count = cpu_to_le32(sg_indx+1);
+               if (user_srbcmd->sg.count)
+                       psg->count = cpu_to_le32(sg_indx+1);
+               else
+                       psg->count = 0;
                status = aac_fib_send(ScsiPortCommand, srbfib, actual_fibsize, FsaNormal, 1, 1, NULL, NULL);
        }
        if (status == -ERESTARTSYS) {