* [PATCH] don't leak dma maps in mptscsih_flush_running_cmds
@ 2004-07-04 14:53 Christoph Hellwig
0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2004-07-04 14:53 UTC (permalink / raw)
To: Emoore; +Cc: linux-scsi
the scsi_device_online() check is bogus, we need to unmap for all
commands, not online for devices that are online.
--- 1.13/drivers/message/fusion/linux_compat.h 2004-06-23 16:48:43 +02:00
+++ edited/drivers/message/fusion/linux_compat.h 2004-07-04 18:47:18 +02:00
@@ -3,16 +3,5 @@
#ifndef FUSION_LINUX_COMPAT_H
#define FUSION_LINUX_COMPAT_H
-#include <linux/version.h>
-#include <scsi/scsi_device.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,6))
-static int inline scsi_device_online(struct scsi_device *sdev)
-{
- return sdev->online;
-}
-#endif
-
-
/*}-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#endif /* _LINUX_COMPAT_H */
--- 1.42/drivers/message/fusion/mptscsih.c 2004-06-23 16:48:44 +02:00
+++ edited/drivers/message/fusion/mptscsih.c 2004-07-04 18:47:07 +02:00
@@ -995,19 +994,18 @@
* Do OS callback
* Free driver resources (chain, msg buffers)
*/
- if (scsi_device_online(SCpnt->device)) {
- if (SCpnt->use_sg) {
- pci_unmap_sg(hd->ioc->pcidev,
- (struct scatterlist *) SCpnt->request_buffer,
- SCpnt->use_sg,
- SCpnt->sc_data_direction);
- } else if (SCpnt->request_bufflen) {
- pci_unmap_single(hd->ioc->pcidev,
- SCpnt->SCp.dma_handle,
- SCpnt->request_bufflen,
- SCpnt->sc_data_direction);
- }
+ if (SCpnt->use_sg) {
+ pci_unmap_sg(hd->ioc->pcidev,
+ (struct scatterlist *) SCpnt->request_buffer,
+ SCpnt->use_sg,
+ SCpnt->sc_data_direction);
+ } else if (SCpnt->request_bufflen) {
+ pci_unmap_single(hd->ioc->pcidev,
+ SCpnt->SCp.dma_handle,
+ SCpnt->request_bufflen,
+ SCpnt->sc_data_direction);
}
+
SCpnt->result = DID_RESET << 16;
SCpnt->host_scribble = NULL;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-07-04 14:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-04 14:53 [PATCH] don't leak dma maps in mptscsih_flush_running_cmds Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox