Re: [PATCH] libata: fix use-after-free during driver unload/unplug

From: Mark Lord
Date: Thu May 26 2005 - 20:42:44 EST


Jeff Garzik wrote:

qstor's ->host_stop() disables global interrupts, and I didn't know if you really wanted to do that prior to ->port_stop().

I would much prefer to eliminate the ->host_stop_prewalk() hook, and simply call ->host_stop after all ->port_stop() calls complete, if qstor doesn't need the pre-walk.

Ahh.. of course. I must have misread your original.

Yes, sata_qstor generally assumes that host_stop should completely
stop the host from operating.. and thereby expects any port_stop()
calls to happen before host_stop(). So, yup, the changes you have
seem to be useful here.

If we didn't want to have a prewalk() method, then we could hack
sata_qstor to keep a count of active ("non stopped") ports,
and automatically do the global (chip) interrupt disable from
port_stop() whenever the count hits zero.

Cheers
-
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/