Skip to content

Commit 2f5d1f7

Browse files
Mahesh RajashekharaJames Bottomley
authored andcommitted
aacraid: IOCTL pass-through command fix
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>
1 parent 46154a0 commit 2f5d1f7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/scsi/aacraid/commctrl.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,10 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
689689
kfree (usg);
690690
}
691691
srbcmd->count = cpu_to_le32(byte_count);
692-
psg->count = cpu_to_le32(sg_indx+1);
692+
if (user_srbcmd->sg.count)
693+
psg->count = cpu_to_le32(sg_indx+1);
694+
else
695+
psg->count = 0;
693696
status = aac_fib_send(ScsiPortCommand64, srbfib, actual_fibsize, FsaNormal, 1, 1,NULL,NULL);
694697
} else {
695698
struct user_sgmap* upsg = &user_srbcmd->sg;
@@ -775,7 +778,10 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
775778
}
776779
}
777780
srbcmd->count = cpu_to_le32(byte_count);
778-
psg->count = cpu_to_le32(sg_indx+1);
781+
if (user_srbcmd->sg.count)
782+
psg->count = cpu_to_le32(sg_indx+1);
783+
else
784+
psg->count = 0;
779785
status = aac_fib_send(ScsiPortCommand, srbfib, actual_fibsize, FsaNormal, 1, 1, NULL, NULL);
780786
}
781787
if (status == -ERESTARTSYS) {

0 commit comments

Comments
 (0)