scsi/gdth: fix crash in gdth_timeout if no gdth controllers found

If the gdth module is loaded (or compiled in), the gdth_timeout function
gets started even if no actual gdth controllers are found b the probing.

That ends up not only being unnecessary, but also causes a crash due to
the function blindly just trying to pick the first entry off the
"gdth_instances" list, and accessing it - which obviously doesn't work
if the list is empty!

Noticed by Ingo Molnar.

Tested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+4
+4
drivers/scsi/gdth.c
··· 5213 #endif /* CONFIG_PCI */ 5214 5215 TRACE2(("gdth_detect() %d controller detected\n", gdth_ctr_count)); 5216 #ifdef GDTH_STATISTICS 5217 TRACE2(("gdth_detect(): Initializing timer !\n")); 5218 init_timer(&gdth_timer);
··· 5213 #endif /* CONFIG_PCI */ 5214 5215 TRACE2(("gdth_detect() %d controller detected\n", gdth_ctr_count)); 5216 + 5217 + if (list_empty(&gdth_instances)) 5218 + return -ENODEV; 5219 + 5220 #ifdef GDTH_STATISTICS 5221 TRACE2(("gdth_detect(): Initializing timer !\n")); 5222 init_timer(&gdth_timer);