libata: don't use on-stack sense buffer
authorTejun Heo <tj@kernel.org>
Mon, 2 Mar 2009 09:55:16 +0000 (18:55 +0900)
committerJeff Garzik <jgarzik@redhat.com>
Thu, 5 Mar 2009 12:25:10 +0000 (07:25 -0500)
sense_buffer is used as DMA target and shouldn't be allocated on
stack.  Use ap->sector_buf instead.  This problem is spotted by Chuck
Ebbert.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/libata-eh.c

index ce2ef04..009ccc7 100644 (file)
@@ -2901,7 +2901,7 @@ static int atapi_eh_clear_ua(struct ata_device *dev)
        int i;
 
        for (i = 0; i < ATA_EH_UA_TRIES; i++) {
-               u8 sense_buffer[SCSI_SENSE_BUFFERSIZE];
+               u8 *sense_buffer = dev->link->ap->sector_buf;
                u8 sense_key = 0;
                unsigned int err_mask;