libata: fix DMA to stack in reading devslp_timing parameters
authorDavid Woodhouse <dwmw2@infradead.org>
Fri, 29 Mar 2013 11:54:55 +0000 (11:54 +0000)
committerJeff Garzik <jgarzik@redhat.com>
Wed, 3 Apr 2013 23:45:57 +0000 (19:45 -0400)
Commit 803739d25c2343da6d2f95eebdcbc08bf67097d4 ("[libata] replace
sata_settings with devslp_timing"), which was also Cc: stable, used a
stack buffer to receive data from ata_read_log_page(), which triggers
the following warning:
 ahci 0000:00:1f.2: DMA-API: device driver maps memory fromstack [addr=ffff880140469948]

Fix this by using ap->sector_buf instead of a stack buffer.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: stable@kernel.org
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/libata-core.c

index 0075944a64dcd5886d8058d402ea772057c1fff1..63c743baf920217181bdb6fcd7cde0f3dc61d0c6 100644 (file)
@@ -2329,7 +2329,7 @@ int ata_dev_configure(struct ata_device *dev)
                 * from SATA Settings page of Identify Device Data Log.
                 */
                if (ata_id_has_devslp(dev->id)) {
-                       u8 sata_setting[ATA_SECT_SIZE];
+                       u8 *sata_setting = ap->sector_buf;
                        int i, j;
 
                        dev->flags |= ATA_DFLAG_DEVSLP;