2006-09-12 09:03:26

by Andy Whitcroft

[permalink] [raw]
Subject: [PATCH] BODGE scsi misc module reference count checks with no MODULE_UNLOAD

BODGE scsi misc module reference count checks with no MODULE_UNLOAD

A quick bodge to try and get this to compile for testing.

Signed-off-by: Andy Whitcroft <[email protected]>
---
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 20d2cdf..2acc0cb 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -884,7 +884,11 @@ void scsi_device_put(struct scsi_device

/* The module refcount will be zero if scsi_device_get()
* was called from a module removal routine */
- if (module && module_refcount(module) != 0)
+ if (module
+#ifdef CONFIG_MODULE_UNLOAD
+ && module_refcount(module) != 0
+#endif
+ )
module_put(module);
put_device(&sdev->sdev_gendev);
}


2006-09-12 09:23:07

by Helge Hafting

[permalink] [raw]
Subject: Re: [PATCH] BODGE scsi misc module reference count checks with no MODULE_UNLOAD

Andy Whitcroft wrote:
> BODGE scsi misc module reference count checks with no MODULE_UNLOAD
>
> A quick bodge to try and get this to compile for testing.
>
> Signed-off-by: Andy Whitcroft <[email protected]>
Thanks, this was necessary to compile a non-modular kernel.

Helge Hafting