From: Borislav Petkov Date: Sun, 21 Oct 2012 16:57:56 +0000 (+0200) Subject: libata debugging: Warn when unable to find timing descriptor based on xfer_mode X-Git-Tag: upstream/snapshot3+hdmi~6238^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd705d5ad49bb8894dda2726dcaef8f63ddeba43;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Signed-off-by: Jeff Garzik --- diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 3cc7096..f46fbd3 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; }