All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wang Chen <wangchen@cn.fujitsu.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: NETDEV <netdev@vger.kernel.org>, "David S. Miller" <davem@davemloft.net>
Subject: [PATCH 2/2] IRDA: Do cleanup for dma
Date: Fri, 23 May 2008 13:57:19 +0800	[thread overview]
Message-ID: <48365CBF.4080502@cn.fujitsu.com> (raw)

1. dma should be freed when dma2 request fail.
2. dma2 should be freed too when device close.

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
---
 drivers/net/irda/via-ircc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c
index 58e1287..04ad357 100644
--- a/drivers/net/irda/via-ircc.c
+++ b/drivers/net/irda/via-ircc.c
@@ -1546,6 +1546,7 @@ static int via_ircc_net_open(struct net_device *dev)
 			IRDA_WARNING("%s, unable to allocate dma2=%d\n",
 				     driver_name, self->io.dma2);
 			free_irq(self->io.irq, self);
+			free_dma(self->io.dma);
 			return -EAGAIN;
 		}
 	}
@@ -1606,6 +1607,8 @@ static int via_ircc_net_close(struct net_device *dev)
 	EnAllInt(iobase, OFF);
 	free_irq(self->io.irq, dev);
 	free_dma(self->io.dma);
+	if (self->io.dma2 != self->io.dma)
+		free_dma(self->io.dma2);
 
 	return 0;
 }
-- 
1.5.4.rc3


             reply	other threads:[~2008-05-23  5:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-23  5:57 Wang Chen [this message]
2008-05-29 10:34 ` [PATCH 2/2] IRDA: Do cleanup for dma David Miller
2006-01-21  6:07   ` samuel
2008-05-30  3:09     ` Wang Chen
2008-05-30  9:44     ` David Miller
2008-05-29 13:27   ` Jeff Garzik
2008-05-30  9:44     ` David Miller

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=48365CBF.4080502@cn.fujitsu.com \
    --to=wangchen@cn.fujitsu.com \
    --cc=davem@davemloft.net \
    --cc=jgarzik@pobox.com \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.