From 7dd283adc39b8f3826359694bfb4a365e37a4568 Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Tue, 25 Oct 2011 10:50:58 -0400 Subject: [PATCH] --- yaml --- r: 275826 b: refs/heads/master c: 2f640bf4c94324aeaa1b6385c10aab8c5ad1e1cf h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/usb/storage/protocol.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 650a6be6d90d..e544d60f52ff 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0d145d7d4a241c321c832a810bb6edad18e2217b +refs/heads/master: 2f640bf4c94324aeaa1b6385c10aab8c5ad1e1cf diff --git a/trunk/drivers/usb/storage/protocol.c b/trunk/drivers/usb/storage/protocol.c index 93c1a4d86f51..82dd834709c7 100644 --- a/trunk/drivers/usb/storage/protocol.c +++ b/trunk/drivers/usb/storage/protocol.c @@ -59,7 +59,9 @@ void usb_stor_pad12_command(struct scsi_cmnd *srb, struct us_data *us) { - /* Pad the SCSI command with zeros out to 12 bytes + /* + * Pad the SCSI command with zeros out to 12 bytes. If the + * command already is 12 bytes or longer, leave it alone. * * NOTE: This only works because a scsi_cmnd struct field contains * a unsigned char cmnd[16], so we know we have storage available @@ -67,9 +69,6 @@ void usb_stor_pad12_command(struct scsi_cmnd *srb, struct us_data *us) for (; srb->cmd_len<12; srb->cmd_len++) srb->cmnd[srb->cmd_len] = 0; - /* set command length to 12 bytes */ - srb->cmd_len = 12; - /* send the command to the transport layer */ usb_stor_invoke_transport(srb, us); }