Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] RocketPoint 1520 [hpt366] fails clock stabilization

I just purchased a HighPoint Rocket 1520 SATA controller. There seems to
be no libata driver (yet), but there is an ide driver, hpt366. When the
driver gets loaded, it causes a kernel NULL pointer dereference in
pci_bus_clock_list. It seems to be because the driver is waiting for clock
stabilization in init_hpt37x() which never comes. The driver just
continues on with the pci drvdata set to NULL, instead of a valid clock
entry. The following patch prevents the NULL dereference from happening,
but instead exit with an error.

Acked-by: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Loren M. Lang and committed by
Linus Torvalds
9ea244b4 0c866b51

+4
+4
drivers/ide/pci/hpt366.c
··· 1288 1288 goto init_hpt37X_done; 1289 1289 } 1290 1290 } 1291 + if (!pci_get_drvdata(dev)) { 1292 + printk("No Clock Stabilization!!!\n"); 1293 + return; 1294 + } 1291 1295 pll_recal: 1292 1296 if (adjust & 1) 1293 1297 pll -= (adjust >> 1);