Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.4.1 /drivers/ide/ide-dma.c

Filename:/drivers/ide/ide-dma.c
Lines Added:7
Lines Deleted:1
Also changed in: (Previous) 2.4.1-pre12  2.4.1-pre11  2.4.1-pre10  2.4.1-pre9  2.4.1-pre8  2.4.1-pre6 
(Following) 2.4.2-ac26  2.4.2-ac27  2.4.2-ac28  2.4.3-ac1  2.4.3-ac2  2.4.3-ac3 

Location
[  2.4.1
  [  drivers
    [  ide
       o  ide-dma.c

Patch

diff -u --recursive --new-file v2.4.0/linux/drivers/ide/ide-dma.c linux/drivers/ide/ide-dma.c
--- v2.4.0/linux/drivers/ide/ide-dma.c   Tue Jan  2 16:58:45 2001
+++ linux/drivers/ide/ide-dma.c   Mon Jan 15 13:08:15 2001
@@ -226,6 +226,9 @@
       unsigned char *virt_addr = bh->b_data;
       unsigned int size = bh->b_size;
 
+      if (nents >= PRD_ENTRIES)
+         return 0;
+
       while ((bh = bh->b_reqnext) != NULL) {
          if ((virt_addr + size) != (unsigned char *) bh->b_data)
             break;
@@ -259,6 +262,9 @@
 
    HWIF(drive)->sg_nents = i = ide_build_sglist(HWIF(drive), HWGROUP(drive)->rq);
 
+   if (!i)
+      return 0;
+
    sg = HWIF(drive)->sg_table;
    while (i && sg_dma_len(sg)) {
       u32 cur_addr;
@@ -274,7 +280,7 @@
        */
 
       while (cur_len) {
-         if (++count >= PRD_ENTRIES) {
+         if (count++ >= PRD_ENTRIES) {
             printk("%s: DMA table too small\n", drive->name);
             pci_unmap_sg(HWIF(drive)->pci_dev,
                     HWIF(drive)->sg_table,


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.