All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Knorr <kraxel@bytesex.org>
To: Andrew Morton <akpm@osdl.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [patch] v4l: video-buf update
Date: Tue, 8 Mar 2005 11:44:37 +0100	[thread overview]
Message-ID: <20050308104437.GA30696@bytesex> (raw)

Bugfix: catch pci_map_sg() failures.

Signed-off-by: Gerd Knorr <kraxel@bytesex.org>
---
 drivers/media/video/video-buf.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff -u linux-2.6.11/drivers/media/video/video-buf.c linux/drivers/media/video/video-buf.c
--- linux-2.6.11/drivers/media/video/video-buf.c	2005-03-07 10:13:55.000000000 +0100
+++ linux/drivers/media/video/video-buf.c	2005-03-07 16:38:38.000000000 +0100
@@ -1,5 +1,5 @@
 /*
- * $Id: video-buf.c,v 1.17 2004/12/10 12:33:40 kraxel Exp $
+ * $Id: video-buf.c,v 1.18 2005/02/24 13:32:30 kraxel Exp $
  *
  * generic helper functions for video4linux capture buffers, to handle
  * memory management and PCI DMA.  Right now bttv + saa7134 use it.
@@ -217,9 +217,18 @@
 		return -ENOMEM;
 	}
 
-	if (!dma->bus_addr)
+	if (!dma->bus_addr) {
 		dma->sglen = pci_map_sg(dev,dma->sglist,dma->nr_pages,
 					dma->direction);
+		if (0 == dma->sglen) {
+			printk(KERN_WARNING
+			       "%s: pci_map_sg failed\n",__FUNCTION__);
+			kfree(dma->sglist);
+			dma->sglist = NULL;
+			dma->sglen = 0;
+			return -EIO;
+		}
+	}
 	return 0;
 }
 

-- 
#define printk(args...) fprintf(stderr, ## args)

             reply	other threads:[~2005-03-08 10:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-08 10:44 Gerd Knorr [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-01-20 15:26 [patch] v4l: video-buf update Gerd Knorr

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=20050308104437.GA30696@bytesex \
    --to=kraxel@bytesex.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@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.