summaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorBorislav Petkov <bp@alien8.de>2012-10-21 18:57:56 +0200
committerJeff Garzik <jgarzik@redhat.com>2012-11-16 05:51:11 +0100
commitcd705d5ad49bb8894dda2726dcaef8f63ddeba43 (patch)
treead7070ea0b7d25a52d5de67a5cf3a8369c2d9553 /drivers/ata
parentsata_highbank: mark ahci_highbank_probe as __devinit (diff)
downloadlinux-cd705d5ad49bb8894dda2726dcaef8f63ddeba43.tar.xz
linux-cd705d5ad49bb8894dda2726dcaef8f63ddeba43.zip
libata debugging: Warn when unable to find timing descriptor based on xfer_mode
ata_timing_find_mode could return NULL which is not checked by all low-level ATA drivers using it and cause a NULL ptr deref. Warn at least so that possible issues can get fixed easily. Signed-off-by: Borislav Petkov <bp@alien8.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 3cc7096cfda7..f46fbd3bd3fb 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2942,6 +2942,10 @@ const struct ata_timing *ata_timing_find_mode(u8 xfer_mode)
if (xfer_mode == t->mode)
return t;
+
+ WARN_ONCE(true, "%s: unable to find timing for xfer_mode 0x%x\n",
+ __func__, xfer_mode);
+
return NULL;
}