[PATCH] ppc64 iseries: can't remove viocd module when no cdroms

From: Stephen Rothwell
Date: Tue Feb 01 2005 - 00:00:48 EST


Hi Andrew,

This patch fixes a bug where attempting to remove the viocd module
when no virtual cdroms where actually present would cause an oops.
The driver was not completing its initialisation in this case.

Signed-off-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>

--
Cheers,
Stephen Rothwell sfr@xxxxxxxxxxxxxxxx
http://www.canb.auug.org.au/~sfr/

diff -ruN linus-bk/drivers/cdrom/viocd.c linus-bk.viocd.1/drivers/cdrom/viocd.c
--- linus-bk/drivers/cdrom/viocd.c 2004-11-16 16:05:11.000000000 +1100
+++ linus-bk.viocd.1/drivers/cdrom/viocd.c 2005-02-01 15:52:03.000000000 +1100
@@ -765,8 +765,6 @@
vio_setHandler(viomajorsubtype_cdio, vio_handle_cd_event);

get_viocd_info();
- if (viocd_numdev == 0)
- goto out_undo_vio;

spin_lock_init(&viocd_reqlock);

@@ -786,7 +784,6 @@
dma_free_coherent(iSeries_vio_dev,
sizeof(*viocd_unitinfo) * VIOCD_MAX_CD,
viocd_unitinfo, unitinfo_dmaaddr);
-out_undo_vio:
vio_clearHandler(viomajorsubtype_cdio);
viopath_close(viopath_hostLp, viomajorsubtype_cdio, MAX_CD_REQ + 2);
out_unregister:

Attachment: pgp00000.pgp
Description: PGP signature