take note of the tio->io field before freeing tio. --- diff/drivers/md/dm.c 2003-09-30 17:12:59.000000000 +0100 +++ source/drivers/md/dm.c 2003-09-30 17:12:49.000000000 +0100 @@ -370,8 +370,9 @@ else if (r < 0) { /* error the io and bail out */ + struct dm_io *io = tio->io; free_tio(tio->io->md, tio); - dec_pending(tio->io, -EIO); + dec_pending(io, -EIO); } }