Commit 97f86b38 authored by Oliver Neukum's avatar Oliver Neukum Committed by James Bottomley

[PATCH] fix irq handling for DC395

this fix makes sure that all test in irq handling in that
driver are for NULL thus fixing an oops.
parent 1e8ac078
...@@ -5364,7 +5364,7 @@ DC395x_initAdapter(struct Scsi_Host *host, u32 io_port, u8 irq, u16 index) ...@@ -5364,7 +5364,7 @@ DC395x_initAdapter(struct Scsi_Host *host, u32 io_port, u8 irq, u16 index)
eeprom = &dc395x_trm_eepromBuf[index]; eeprom = &dc395x_trm_eepromBuf[index];
pTempACB = DC395x_pACB_start; pTempACB = DC395x_pACB_start;
if (pTempACB != NULL) { if (pTempACB != NULL) {
for (; (pTempACB != (struct AdapterCtlBlk *) -1);) { while (pTempACB) {
if (pTempACB->IRQLevel == irq) { if (pTempACB->IRQLevel == irq) {
used_irq = 1; used_irq = 1;
break; break;
...@@ -5842,11 +5842,11 @@ DC395x_init(Scsi_Host_Template * host_template, u32 io_port, u8 irq, ...@@ -5842,11 +5842,11 @@ DC395x_init(Scsi_Host_Template * host_template, u32 io_port, u8 irq,
if (!DC395x_pACB_start) { if (!DC395x_pACB_start) {
DC395x_pACB_start = pACB; DC395x_pACB_start = pACB;
DC395x_pACB_current = pACB; DC395x_pACB_current = pACB;
pACB->pNextACB = (struct AdapterCtlBlk *) -1; pACB->pNextACB = NULL;
} else { } else {
DC395x_pACB_current->pNextACB = pACB; DC395x_pACB_current->pNextACB = pACB;
DC395x_pACB_current = pACB; DC395x_pACB_current = pACB;
pACB->pNextACB = (struct AdapterCtlBlk *) -1; pACB->pNextACB = NULL;
} }
/*DC395x_ACB_UNLOCK(pACB,acb_flags); */ /*DC395x_ACB_UNLOCK(pACB,acb_flags); */
return host; return host;
...@@ -6077,13 +6077,13 @@ DC395x_proc_info(char *buffer, char **start, off_t offset, int length, ...@@ -6077,13 +6077,13 @@ DC395x_proc_info(char *buffer, char **start, off_t offset, int length,
pACB = DC395x_pACB_start; pACB = DC395x_pACB_start;
while (pACB != (struct AdapterCtlBlk *) -1) { while (pACB) {
shpnt = pACB->pScsiHost; shpnt = pACB->pScsiHost;
if (shpnt->host_no == hostno) if (shpnt->host_no == hostno)
break; break;
pACB = pACB->pNextACB; pACB = pACB->pNextACB;
} }
if (pACB == (struct AdapterCtlBlk *) -1) if (!pACB)
return -ESRCH; return -ESRCH;
if (!shpnt) if (!shpnt)
...@@ -6306,7 +6306,7 @@ static int DC395x_release(struct Scsi_Host *host) ...@@ -6306,7 +6306,7 @@ static int DC395x_release(struct Scsi_Host *host)
*/ */
int irq_count; int irq_count;
for (irq_count = 0, pACB = DC395x_pACB_start; for (irq_count = 0, pACB = DC395x_pACB_start;
pACB != (struct AdapterCtlBlk *) -1; pACB;
pACB = pACB->pNextACB) { pACB = pACB->pNextACB) {
if (pACB->IRQLevel == host->irq) if (pACB->IRQLevel == host->irq)
++irq_count; ++irq_count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment