Re: [PATCH] fix for ide-scsi crash

From: Willem Riede
Date: Mon Jan 19 2004 - 17:38:19 EST


On Mon, 19 Jan 2004 05:35:58 +0100, Andries.Brouwer wrote:

> - spin_unlock_irq(cmd->device->host->host_lock);
> - (void) ide_do_drive_cmd (drive, rq, ide_end);
> - spin_lock_irq(cmd->device->host->host_lock);
> + {
> + struct Scsi_Host *host = cmd->device->host;
> + spin_unlock_irq(host->host_lock);
> + (void) ide_do_drive_cmd(drive, rq, ide_end);
> + spin_lock_irq(host->host_lock);
> + }

Interesting. So cmd->device->host changed after ide_do_drive_cmd?

That may be a problem if the scsi error handler has to spring
into action for this command, as it uses that field extensively...

> - if (pc) kfree (pc);
> - if (rq) kfree (rq);
> + kfree (pc);
> + kfree (rq);

So it is OK to rely on the NULL check in kfree?

Thanks, Willem Riede.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/