linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: moore@lsil.com
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH] fix dma mapping leak in fusion
Date: Tue, 17 Aug 2004 18:16:42 +0200	[thread overview]
Message-ID: <20040817161642.GA16509@lst.de> (raw)

stop fusion from leaking dma maps when the device has been offlined


--- 1.13/drivers/message/fusion/linux_compat.h	2004-06-23 16:48:43 +02:00
+++ edited/drivers/message/fusion/linux_compat.h	2004-08-17 20:09:21 +02:00
@@ -3,16 +3,4 @@
 #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 */
===== drivers/message/fusion/mptscsih.c 1.45 vs edited =====
--- 1.45/drivers/message/fusion/mptscsih.c	2004-08-03 01:01:01 +02:00
+++ edited/drivers/message/fusion/mptscsih.c	2004-08-17 20:02:54 +02:00
@@ -1019,19 +1019,18 @@
 			 * Do OS callback
 			 * Free driver resources (chain, msg buffers)
 			 */
-			if (scsi_device_online(SCpnt->device)) {
-				if (SCpnt->use_sg) {
-					pci_unmap_sg(ioc->pcidev,
-						(struct scatterlist *) SCpnt->request_buffer,
-						SCpnt->use_sg,
-						SCpnt->sc_data_direction);
-				} else if (SCpnt->request_bufflen) {
-					pci_unmap_single(ioc->pcidev,
-						SCpnt->SCp.dma_handle,
-						SCpnt->request_bufflen,
-						SCpnt->sc_data_direction);
-				}
+			if (SCpnt->use_sg) {
+				pci_unmap_sg(ioc->pcidev,
+					(struct scatterlist *) SCpnt->request_buffer,
+					SCpnt->use_sg,
+					SCpnt->sc_data_direction);
+			} else if (SCpnt->request_bufflen) {
+				pci_unmap_single(ioc->pcidev,
+					SCpnt->SCp.dma_handle,
+					SCpnt->request_bufflen,
+					SCpnt->sc_data_direction);
 			}
+
 			SCpnt->result = DID_RESET << 16;
 			SCpnt->host_scribble = NULL;
 

             reply	other threads:[~2004-08-17 16:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-17 16:16 Christoph Hellwig [this message]
2004-08-19  3:01 ` [PATCH] fix dma mapping leak in fusion Masao Fukuchi
2004-08-19 10:14   ` Christoph Hellwig
2004-08-19 13:14     ` Masao Fukuchi
  -- strict thread matches above, loose matches on Subject: below --
2004-08-17 16:42 Moore, Eric Dean
2004-08-17 16:46 ` Christoph Hellwig
2004-08-17 17:17   ` Christoph Hellwig
2004-08-17 18:18 ` Luben Tuikov
2004-08-19 14:47 Moore, Eric Dean
2004-08-20  3:05 ` Masao Fukuchi
2004-08-20 15:01 Moore, Eric Dean
2004-08-23  1:41 ` Masao Fukuchi
2004-08-23 15:56 Moore, Eric Dean
2004-08-28 19:02 ` Christoph Hellwig
2004-08-30 22:29 Moore, Eric Dean
2004-08-31 12:56 ` Luben Tuikov
2004-08-31 13:14   ` Luben Tuikov
2004-08-31 14:42 Moore, Eric Dean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040817161642.GA16509@lst.de \
    --to=hch@lst.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=moore@lsil.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).