mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-05 22:25:16 +00:00
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>
This commit is contained in:
parent
c37472d3f4
commit
cd705d5ad4
1 changed files with 4 additions and 0 deletions
|
@ -2942,6 +2942,10 @@ const struct ata_timing *ata_timing_find_mode(u8 xfer_mode)
|
||||||
|
|
||||||
if (xfer_mode == t->mode)
|
if (xfer_mode == t->mode)
|
||||||
return t;
|
return t;
|
||||||
|
|
||||||
|
WARN_ONCE(true, "%s: unable to find timing for xfer_mode 0x%x\n",
|
||||||
|
__func__, xfer_mode);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue