Skip to content

Commit

Permalink
libata: fix DMA to stack in reading devslp_timing parameters
Browse files Browse the repository at this point in the history
Commit 803739d ("[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>
  • Loading branch information
dwmw2 authored and Jeff Garzik committed Apr 3, 2013
1 parent b55f84e commit 8e725c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8e725c7

Please sign in to comment.