@@ -2205,13 +2205,16 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
ahd_print_path(ahd, scb);
printk("data overrun detected %s. Tag == 0x%x.\n",
ahd_lookup_phase_entry(lastphase)->phasemsg,
- SCB_GET_TAG(scb));
+ scb != NULL ? SCB_GET_TAG(scb) : 0);
ahd_print_path(ahd, scb);
printk("%s seen Data Phase. Length = %ld. "
"NumSGs = %d.\n",
ahd_inb(ahd, SEQ_FLAGS) & DPHASE
? "Have" : "Haven't",
- ahd_get_transfer_length(scb), scb->sg_count);
+ scb != NULL ? ahd_get_transfer_length(scb) : -1,
+ scb != NULL ? scb->sg_count : -1);
+ if (scb == NULL)
+ break;
ahd_dump_sglist(scb);
}
#endif
NULL pointer dereference is possible when compiled with AHD_DEBUG and AHD_SHOW_RECOVERY is set if data in SCBPTR и SCBPTR+1 ports is incorrect. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Boris Belyavtsev <bbelyavtsev@usergate.com> --- drivers/scsi/aic7xxx/aic79xx_core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)