]> git.neil.brown.name Git - history.git/commitdiff
Linux 2.2.17pre18 2.2.17pre18
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:22:00 +0000 (15:22 -0500)
committerAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:22:00 +0000 (15:22 -0500)
o Fix a race in the NFS code (Andi Kleen)
o Fix a pair of arcnet resource leaks on error (Arnaldo Carvalho de Melo)
o Fix PPC601 booting, bitops bug and oddments (Paul Mackerras)
o Fix resource leaks on error in several drivers
     (Arnaldo Carvalho de Melo)
o Add SCR-2430 to cdroms we limit xfer sizes on (Ron)
o Fix a small error in the vfb driver (Geert Uytterhoeven)
o Fix further bonding driver bug (John Newbigin)
o Irda should compile again
o Fix irda parameter parser (Russell King)
o Hold the external amp on the Voyetra card active
while CD is an input (Alan Cox)
o HDLC driver fixes (Krzysztof Halasa)
o Ksyms for external stuck task tracker module (Andi Kleen)
o Fix spurious setting of err in sockets (Dave Miller)
o Fix net_bh race from skb_dequeue (??)
o Fix cs46xx record bug (Alan Cox)
o Fix ac97 init wait error (doh..) (Alan Cox)

31 files changed:
Makefile
arch/ppc/kernel/head.S
arch/ppc/kernel/misc.S
drivers/block/ide-cd.c
drivers/macintosh/macserial.c
drivers/net/3c59x.c
drivers/net/arlan.c
drivers/net/bonding.c
drivers/net/c101.c
drivers/net/com20020.c
drivers/net/com90io.c
drivers/net/comx-hw-comx.c
drivers/net/comx-hw-locomx.c
drivers/net/comx-hw-mixcom.c
drivers/net/comx-proto-fr.c
drivers/net/comx-proto-ppp.c
drivers/net/comx.c
drivers/net/hd64570.h
drivers/net/hostess_sv11.c
drivers/net/hydra.c
drivers/net/n2.c
drivers/net/sealevel.c
drivers/sound/ac97_codec.c
drivers/sound/cs46xx.c
drivers/video/vfb.c
include/asm-ppc/bitops.h
include/asm-ppc/system.h
kernel/ksyms.c
net/irda/af_irda.c
net/irda/parameters.c
net/sunrpc/sched.c

index e662f2335b04062c9f6d09cdca46202f045d7947..0168345c212a514145da0bc5e4c692f6f37d1a72 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 2
 SUBLEVEL = 17
-EXTRAVERSION = pre17
+EXTRAVERSION = pre18
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
 
index ec184b7b2a80e365591d5b647c145225e163d9a0..e7941839099d56462f52c1aeeb1030154a30a45b 100644 (file)
@@ -1829,14 +1829,12 @@ mmu_off:
        addi    r4, r3, __secondary_start - _start
        mfmsr   r3
        andi.   r0,r3,MSR_DR|MSR_IR             /* MMU enabled? */
-       beq     1f
-       ori     r3,r3,MSR_DR|MSR_IR
-       xori    r3,r3,MSR_DR|MSR_IR
+       beqlr
+       andc    r3,r3,r0
        mtspr   SRR0,r4
        mtspr   SRR1,r3
-       sync
+       SYNC
        rfi
-1:     blr
 
 /*
  * This code is jumped to from the startup code to copy
@@ -1956,7 +1954,7 @@ start_here:
        mfspr   r9,PVR
        rlwinm  r9,r9,16,16,31
        cmpi    0,r9,1
-       beq     4f                      /* not needed for 601 */
+       beq     6f                      /* not needed for 601 */
        mfspr   r11,HID0
        andi.   r0,r11,HID0_DCE
        ori     r11,r11,HID0_ICE|HID0_DCE
index 223f5c98456c68f8fe71f5b22a0e5764c3fe7e36..5ec8b36d985e84b8927b0364ad23777647b544b5 100644 (file)
@@ -275,10 +275,8 @@ _GLOBAL(atomic_dec_and_test)
        stwcx.  r5,0,r3         /* Update with new value */
        bne-    10b             /* Retry if "reservation" (i.e. lock) lost */
        SMP_MB
-       cmpi    0,r5,0          /* Return 'true' IFF 0 */
-       li      r3,1
-       beqlr
-       li      r3,0
+       cntlzw  r3,r5
+       srwi    r3,r3,5
        blr
 _GLOBAL(atomic_clear_mask)
        SMP_WMB                 /* wmb() */
@@ -406,48 +404,59 @@ _GLOBAL(_outsl_ns)
        blr     
 
 /*
- * Extended precision shifts
+ * Extended precision shifts.
+ * 
+ * Updated to be valid for shift counts from 0 to 63 inclusive.
+ * -- Gabriel
  *
  * R3/R4 has 64 bit value
  * R5    has shift count
  * result in R3/R4
  *
- *  ashrdi3:     XXXYYY/ZZZAAA -> SSSXXX/YYYZZZ
- *  ashldi3:     XXXYYY/ZZZAAA -> YYYZZZ/AAA000
- *  lshrdi3:     XXXYYY/ZZZAAA -> 000XXX/YYYZZZ
+ *  ashrdi3: arithmetic right shift (sign propagation)     
+ *  lshrdi3: logical right shift       
+ *  ashldi3: left shift
  */
 _GLOBAL(__ashrdi3)
-       li      r6,32
-       sub     r6,r6,r5
-       slw     r7,r3,r6        /* isolate YYY */
-       srw     r4,r4,r5        /* isolate ZZZ */
-       or      r4,r4,r7        /* YYYZZZ */
-       sraw    r3,r3,r5        /* SSSXXX */
+       subfic  r6,r5,32        
+       srw     r4,r4,r5        # LSW = count > 31 ? 0 : LSW >> count
+       addi    r7,r5,32        # could be xori, or addi with -32
+       slw     r6,r3,r6        # t1 = count > 31 ? 0 : MSW << (32-count)
+       rlwinm  r8,r7,0,32      # t3 = (count < 32) ? 32 : 0
+       sraw    r7,r3,r7        # t2 = MSW >> (count-32)
+       or      r4,r4,r6        # LSW |= t1
+       slw     r7,r7,r8        # t2 = (count < 32) ? 0 : t2
+       sraw    r3,r3,r5        # MSW = MSW >> count
+       or      r4,r4,r7        # LSW |= t2
        blr
 
 _GLOBAL(__ashldi3)
-       li      r6,32
-       sub     r6,r6,r5
-       srw     r7,r4,r6        /* isolate ZZZ */
-       slw     r4,r4,r5        /* AAA000 */
-       slw     r3,r3,r5        /* YYY--- */
-       or      r3,r3,r7        /* YYYZZZ */
+       subfic  r6,r5,32        
+       slw     r3,r3,r5        # MSW = count > 31 ? 0 : MSW << count
+       addi    r7,r5,32        # could be xori, or addi with -32
+       srw     r6,r4,r6        # t1 = count > 31 ? 0 : LSW >> (32-count)
+       slw     r7,r4,r7        # t2 = count < 32 ? 0 : LSW << (count-32)
+       or      r3,r3,r6        # MSW |= t1
+       slw     r4,r4,r5        # LSW = LSW << count
+       or      r3,r3,r7        # MSW |= t2
        blr
 
 _GLOBAL(__lshrdi3)
-       li      r6,32
-       sub     r6,r6,r5
-       slw     r7,r3,r6        /* isolate YYY */
-       srw     r4,r4,r5        /* isolate ZZZ */
-       or      r4,r4,r7        /* YYYZZZ */
-       srw     r3,r3,r5        /* 000XXX */
+       subfic  r6,r5,32        
+       srw     r4,r4,r5        # LSW = count > 31 ? 0 : LSW >> count
+       addi    r7,r5,32        # could be xori, or addi with -32
+       slw     r6,r3,r6        # t1 = count > 31 ? 0 : MSW << (32-count)
+       srw     r7,r3,r7        # t2 = count < 32 ? 0 : MSW >> (count-32)
+       or      r4,r4,r6        # LSW |= t1
+       srw     r3,r3,r5        # MSW = MSW >> count
+       or      r4,r4,r7        # LSW |= t2 
        blr
 
 _GLOBAL(abs)
-       cmpi    0,r3,0
-       bge     10f
-       neg     r3,r3
-10:    blr
+       srawi   r4,r3,31
+       xor     r3,r3,r4
+       sub     r3,r3,r4
+       blr
 
 _GLOBAL(_get_SP)
        mr      r3,r1           /* Close enough */
index bb2f7a7364fab35cc940b7382a8e2dcb41671d57..6fd10edd98c2e57076eebf71172a63c52268b2fa 100644 (file)
@@ -2391,7 +2391,9 @@ int ide_cdrom_setup (ide_drive_t *drive)
        CDROM_CONFIG_FLAGS (drive)->limit_nframes = 0;
        if (drive->id != NULL) {
                /* a testament to the nice quality of Samsung drives... */
-               if (!strcmp(drive->id->model, "SAMSUNG CD-ROM SCR-2430"))
+               if (!strcmp(drive->id->model, "SAMSUNG SCR-2030"))
+                       CDROM_CONFIG_FLAGS (drive)->limit_nframes = 1;
+               else if (!strcmp(drive->id->model, "SAMSUNG CD-ROM SCR-2430"))
                        CDROM_CONFIG_FLAGS (drive)->limit_nframes = 1;
                else if (!strcmp(drive->id->model, "SAMSUNG CD-ROM SCR-2432"))
                        CDROM_CONFIG_FLAGS (drive)->limit_nframes = 1;
index 238360be99d3d6477e3e9998237c9fdcbd0a0895..d3d5686c9758c06dbb0d307afcee3ddd76357fcc 100644 (file)
@@ -2295,7 +2295,7 @@ chan_init(struct mac_serial *zss, struct mac_zschannel *zs_chan,
        zss->irq = ch->intrs[0].line;
        zss->has_dma = 0;
 #if !defined(CONFIG_KGDB) && defined(SUPPORT_SERIAL_DMA)
-       if (ch->n_addrs == 3 && ch->n_intrs == 3)
+       if (ch->n_addrs >= 3 && ch->n_intrs == 3)
                zss->has_dma = 1;
 #endif
        zss->dma_initted = 0;
index 6ad5d23a1be999b68b924af5d9f87371b7313e9a..4b27c79c4492bdf434570db2aea2e728edece665 100644 (file)
@@ -637,6 +637,8 @@ static dev_node_t *vortex_attach(dev_locator_t *loc)
        dev = vortex_probe1(bus, devfn, NULL, io, irq, chip_idx, MAX_UNITS+1);
        if (dev) {
                dev_node_t *node = kmalloc(sizeof(dev_node_t), GFP_KERNEL);
+               if (!node)
+                       return NULL;
                strcpy(node->dev_name, dev->name);
                node->major = node->minor = 0;
                node->next = NULL;
@@ -876,6 +878,8 @@ static struct device *vortex_probe1(int pci_bus, int pci_devfn,
        /* Make certain the descriptor lists are aligned. */
        {
                void *mem = kmalloc(sizeof(*vp) + 15, GFP_KERNEL);
+               if (!mem)
+                       return NULL;
                vp =  (void *)(((long)mem + 15) & ~15);
                vp->priv_addr = mem;
        }
index a7f9ac4064f3784c832de4cac3e4271957365df3..2fbd45e94fb618eb6fac37cb07f1ce47fd38588b 100644 (file)
@@ -3,6 +3,11 @@
  *  Copyright (C) 1998 Elmer.Joandi@ut.ee, +37-255-13500        
  *  Gnu Public License applies
  * This module provides support for the Arlan 655 card made by Aironet
+ *
+ * Changes:
+ * Arnaldo Carvalho de Melo <acme@conectiva.com.br> - 08/15/2000
+ * - fix some leaks on failure at arlan_allocate_device
+ * - check kmalloc in arlan_probe and init_module
  */
 
 
@@ -1197,16 +1202,20 @@ __initfunctio(static int
                return 0;
        }
 
-       memset(dev->priv,0,sizeof(struct arlan_private));
+       if (devs)
+               memset(dev->priv,0,sizeof(struct arlan_private));
 
        ((struct arlan_private *) dev->priv)->conf =
            kmalloc(sizeof(struct arlan_shmem), GFP_KERNEL);
 
-       if (dev == NULL || dev->priv == NULL ||
-           ((struct arlan_private *) dev->priv)->conf == NULL)
+       if (((struct arlan_private *) dev->priv)->conf == NULL)
        {
-               return 0;
                printk(KERN_CRIT " No memory at arlan_allocate_device \n");
+               if (!devs)
+                       kfree(dev);
+               else
+                       kfree(dev->priv);
+               return 0;
        }
        /* Fill in the 'dev' fields. */
        dev->base_addr = 0;
@@ -2032,12 +2041,15 @@ __initfunctio(int arlan_probe(struct device *dev))
        printk("Arlan driver %s\n", arlan_version);
 
        if (arlan_probe_everywhere(dev))
-               return ENODEV;
+               return -ENODEV;
 
        arlans_found++;
 
-       if (arlans_found == 1)
+       if (arlans_found == 1) {
                siteName = kmalloc(100, GFP_KERNEL);
+               if (!siteName)
+                       return -ENOMEM;
+       }
        return 0;
 }
 
@@ -2069,10 +2081,13 @@ int init_module(void)
        }
        for (i = 0; i < numDevices && i < MAX_ARLANS; i++)
        {
-               if (!arlan_allocate_device(i, NULL))
+               if (!arlan_allocate_device(i, NULL)) {
+                       kfree(siteName);
                        return -1;
+               }
                if (arlan_device[i] == NULL)
                {
+                       kfree(siteName);
                        printk(KERN_CRIT "arlan: Not Enough memory \n");
                        return -1;
                }
index 9124d25ca9d3be42916675bfdb8059442226ada3..48917a65fc5e9904692cf9d372c6259cb0e8b00e 100644 (file)
  *
  * v0.1 - first working version.
  * v0.2 - changed stats to be calculated by summing slaves stats.
+ *
+ * Changes:
+ * Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * - fix leaks on failure at bond_init
  * 
  */
 
@@ -87,7 +91,8 @@ static int bond_close(struct device *master)
                slave=next;
                queue->num_slaves--;
        }
-
+       queue->head = NULL;
+       
        restore_flags(flags);
 
        MOD_DEC_USE_COUNT;
@@ -210,14 +215,19 @@ __initfunc(int bond_init(struct device *dev))
        bond = (struct bonding *) dev->priv;
 
        bond->queue = kmalloc(sizeof(struct slave_queue), GFP_KERNEL);
-       if (bond->queue == NULL)
+       if (bond->queue == NULL) {
+               kfree(dev->priv);
                return -ENOMEM;
+       }
 
        memset(bond->queue, 0, sizeof(struct slave_queue));
 
        bond->stats = kmalloc(sizeof(struct enet_statistics), GFP_KERNEL);
-       if (bond->stats == NULL)
+       if (bond->stats == NULL) {
+               kfree(dev->priv);
+               kfree(bond->queue);
                return -ENOMEM;
+       }
 
        memset(bond->stats, 0, sizeof(struct enet_statistics));
 
index 0860eb154c56d60e21b4583267d474aaba822ecd..4d23ea0f24edc2ee3d00cc3f7fe29c2a99c9735c 100644 (file)
@@ -117,12 +117,14 @@ static __inline__ int set_clock(port_t *port, int clock)
 static __inline__ void open_port(port_t *port)
 {
        writeb(1, port->win0base+C101_DTR);
+       sca_out(0, MSCI1_OFFSET + CTL, port); /* RTS uses ch#2 output */
 }
 
 
 static __inline__ void close_port(port_t *port)
 {
        writeb(0, port->win0base+C101_DTR);
+       sca_out(CTL_NORTS, MSCI1_OFFSET + CTL, port);
 }
 
 
index 093a5acf00c8e8c4cdf529fedbc47e273e9879f0..131a76288c90d9953fc6f0bd68d02eec8ecd7581 100644 (file)
@@ -1,6 +1,6 @@
 /*     $Id: com20020.c,v 1.6 1997/11/09 11:04:58 mj Exp $
 
-        Written 1997 by David Woodhouse <dwmw2@cam.ac.uk>
+        Written 1997 by David Woodhouse <dwmw2@infradead.org>
 
        Derived from the original arcnet.c,
        Written 1994-1996 by Avery Pennarun,
@@ -995,8 +995,11 @@ int init_module(void)
 
   if (dev->irq==2) dev->irq=9;
 
-  if (register_netdev(dev) != 0)
+  if (register_netdev(dev) != 0) {
+    kfree(dev->name);
+    kfree(dev);
     return -EIO;
+  }
 
   /* Increase use count of arcnet.o */
   arcnet_use_count(1);
index 3096544602b37e98720e4960055fec52a7e146b0..31fadecaa13758c4847f6044d7239b01b4d8f618 100644 (file)
@@ -1,6 +1,6 @@
 /*     $Id: com90io.c,v 1.6 1997/11/09 11:04:59 mj Exp $
 
-        Written 1997 by David Woodhouse <dwmw2@cam.ac.uk>
+        Written 1997 by David Woodhouse <dwmw2@infradead.org>
 
        Derived from the original arcnet.c,
        Written 1994-1996 by Avery Pennarun,
@@ -871,8 +871,11 @@ int init_module(void)
 
   if (dev->irq==2) dev->irq=9;
 
-  if (register_netdev(dev) != 0)
+  if (register_netdev(dev) != 0) {
+    kfree(dev->name);
+    kfree(dev);
     return -EIO;
+  }
 
   /* Increase use count of arcnet.o */
   arcnet_use_count(1);
index 644007f6503453c0090c64941e9adf077cba4183..f0713f751b67d14b7c287e7c4be59d92c5896394 100644 (file)
@@ -9,6 +9,9 @@
  *
  * Copyright (C) 1995-2000 ITConsult-Pro Co. <info@itc.hu>
  *
+ * Contributors:
+ * Arnaldo Carvalho de Melo <acme@conectiva.com.br> - 0.86
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version
  * Version 0.85 (00/01/14):
  *             - some additional workarounds :/
  *             - printk cleanups
+ * Version 0.86 (00/08/15):
+ *             - resource release on failure at COMX_init
  */
 
-#define VERSION "0.85"
+#define VERSION "0.86"
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -1241,7 +1246,7 @@ static int COMX_init(struct device *dev)
 
        if ((new_file = create_proc_entry(FILENAME_IO, S_IFREG | 0644, ch->procdir))
            == NULL) {
-               return -EIO;
+               goto cleanup_HW_privdata;
        }
        new_file->data = (void *)new_file;
        new_file->read_proc = &comxhw_read_proc;
@@ -1252,7 +1257,7 @@ static int COMX_init(struct device *dev)
 
        if ((new_file = create_proc_entry(FILENAME_IRQ, S_IFREG | 0644, ch->procdir))
            == NULL) {
-               return -EIO;
+               goto cleanup_filename_io;
        }
        new_file->data = (void *)new_file;
        new_file->read_proc = &comxhw_read_proc;
@@ -1263,8 +1268,9 @@ static int COMX_init(struct device *dev)
 
        if ((new_file = create_proc_entry(FILENAME_CHANNEL, S_IFREG | 0644, 
            ch->procdir)) == NULL) {
-               return -EIO;
+               goto cleanup_filename_irq;
        }
+
        new_file->data = (void *)new_file;
        new_file->read_proc = &comxhw_read_proc;
        new_file->write_proc = &comxhw_write_proc;
@@ -1275,7 +1281,7 @@ static int COMX_init(struct device *dev)
        if (ch->hardware == &hicomx_hw || ch->hardware == &cmx_hw) {
                if ((new_file = create_proc_entry(FILENAME_CLOCK, S_IFREG | 0644, 
                   ch->procdir)) == NULL) {
-                       return -EIO;
+                       goto cleanup_filename_channel;
                }
                new_file->data = (void *)new_file;
                new_file->read_proc = &comxhw_read_proc;
@@ -1287,7 +1293,7 @@ static int COMX_init(struct device *dev)
 
        if ((new_file = create_proc_entry(FILENAME_MEMADDR, S_IFREG | 0644, 
            ch->procdir)) == NULL) {
-               return -EIO;
+               goto cleanup_filename_clock;
        }
        new_file->data = (void *)new_file;
        new_file->read_proc = &comxhw_read_proc;
@@ -1298,7 +1304,7 @@ static int COMX_init(struct device *dev)
 
        if ((new_file = create_proc_entry(FILENAME_TWIN, S_IFREG | 0444, 
            ch->procdir)) == NULL) {
-               return -EIO;
+               goto cleanup_filename_memaddr;
        }
        new_file->data = (void *)new_file;
        new_file->read_proc = &comxhw_read_proc;
@@ -1308,7 +1314,7 @@ static int COMX_init(struct device *dev)
 
        if ((new_file = create_proc_entry(FILENAME_FIRMWARE, S_IFREG | 0644, 
            ch->procdir)) == NULL) {
-               return -EIO;
+               goto cleanup_filename_twin;
        }
        new_file->data = (void *)new_file;
        new_file->read_proc = &comxhw_read_proc;
@@ -1350,6 +1356,22 @@ static int COMX_init(struct device *dev)
 
        MOD_INC_USE_COUNT;
        return 0;
+cleanup_filename_twin:
+       remove_proc_entry(FILENAME_TWIN, ch->procdir);
+cleanup_filename_memaddr:
+       remove_proc_entry(FILENAME_MEMADDR, ch->procdir);
+cleanup_filename_clock:
+       if (ch->hardware == &hicomx_hw || ch->hardware == &cmx_hw)
+               remove_proc_entry(FILENAME_CLOCK, ch->procdir);
+cleanup_filename_channel:
+       remove_proc_entry(FILENAME_CHANNEL, ch->procdir);
+cleanup_filename_irq:
+       remove_proc_entry(FILENAME_IRQ, ch->procdir);
+cleanup_filename_io:
+       remove_proc_entry(FILENAME_IO, ch->procdir);
+cleanup_HW_privdata:
+       kfree(ch->HW_privdata);
+       return -EIO;
 }
 
 /* Called on echo valami >boardtype */
index 1fcc3bf28289f498ccb7082f705b29b4cd4dbf89..7a4cac65f5650a77f81233ec91cfe98e4f9f0853 100644 (file)
@@ -7,6 +7,9 @@
  * Based on skeleton code and old LoCOMX driver by Tivadar Szemethy <tiv@itc.hu> 
  * and the hostess_sv11 driver
  *
+ * Contributors:
+ * Arnaldo Carvalho de Melo <acme@conectiva.com.br> (0.14)
+ *
  * Copyright (C) 1999 ITConsult-Pro Co. <info@itc.hu>
  *
  * This program is free software; you can redistribute it and/or
  * Version 0.13 (99/07/08):
  *             - Fix the transmitter status check
  *             - Handle the net device statistics better
+ * Version 0.14 (00/08/15):
+ *             - resource release on failure at LOCOMX_init
  */
 
-#define VERSION "0.13"
+#define VERSION "0.14"
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -392,7 +397,7 @@ static int LOCOMX_init(struct device *dev)
        /* Register /proc files */
        if ((new_file = create_proc_entry(FILENAME_IO, S_IFREG | 0644, 
            ch->procdir)) == NULL) {
-               return -EIO;
+               goto cleanup_HW_privdata;
        }
        new_file->data = (void *)new_file;
        new_file->read_proc = &locomx_read_proc;
@@ -402,7 +407,7 @@ static int LOCOMX_init(struct device *dev)
 
        if ((new_file = create_proc_entry(FILENAME_IRQ, S_IFREG | 0644, 
            ch->procdir)) == NULL)  {
-               return -EIO;
+               goto cleanup_filename_io;
        }
        new_file->data = (void *)new_file;
        new_file->read_proc = &locomx_read_proc;
@@ -442,6 +447,11 @@ static int LOCOMX_init(struct device *dev)
        /* O.K. Count one more user on this module */
        MOD_INC_USE_COUNT;
        return 0;
+cleanup_filename_io:
+       remove_proc_entry(FILENAME_IO, ch->procdir);
+cleanup_HW_privdata:
+       kfree(ch->HW_privdata);
+       return -EIO;
 }
 
 
index 7153e1ee4af278c90e416a009791cba571c6b70b..666b3de9b558fada374f337ab9debeff9060a8bf 100644 (file)
@@ -8,6 +8,9 @@
  *
  * Copyright (C) 1998-1999 ITConsult-Pro Co. <info@itc.hu>
  *
+ * Contributors:
+ * Arnaldo Carvalho de Melo <acme@conectiva.com.br> (0.65)
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version
  *
  * Version 0.64 (99/12/01):
  *             - some more cosmetical fixes
+ *
+ * Version 0.65 (00/08/15)
+ *             - resource release on failure at MIXCOM_init
  */
 
-#define VERSION "0.64"
+#define VERSION "0.65"
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -825,8 +831,9 @@ static int MIXCOM_init(struct device *dev) {
 
        if ((new_file = create_proc_entry(FILENAME_IO, S_IFREG | 0644, 
            ch->procdir)) == NULL) {
-               return -EIO;
+               goto cleanup_HW_privdata;
        }
+
        new_file->data = (void *)new_file;
        new_file->read_proc = &mixcom_read_proc;
        new_file->write_proc = &mixcom_write_proc;
@@ -835,8 +842,9 @@ static int MIXCOM_init(struct device *dev) {
 
        if ((new_file = create_proc_entry(FILENAME_IRQ, S_IFREG | 0644, 
            ch->procdir)) == NULL) {
-               return -EIO;
+               goto cleanup_filename_io;
        }
+
        new_file->data = (void *)new_file;
        new_file->read_proc = &mixcom_read_proc;
        new_file->write_proc = &mixcom_write_proc;
@@ -857,8 +865,9 @@ static int MIXCOM_init(struct device *dev) {
 
        if ((new_file = create_proc_entry(FILENAME_CHANNEL, S_IFREG | 0644, 
            ch->procdir)) == NULL) {
-               return -EIO;
+               goto cleanup_filename_irq;
        }
+
        new_file->data = (void *)new_file;
        new_file->read_proc = &mixcom_read_proc;
        new_file->write_proc = &mixcom_write_proc;
@@ -867,8 +876,9 @@ static int MIXCOM_init(struct device *dev) {
 
        if ((new_file = create_proc_entry(FILENAME_TWIN, S_IFREG | 0444, 
            ch->procdir)) == NULL) {
-               return -EIO;
+               goto cleanup_filename_channel;
        }
+
        new_file->data = (void *)new_file;
        new_file->read_proc = &mixcom_read_proc;
        new_file->write_proc = &mixcom_write_proc;
@@ -892,6 +902,15 @@ static int MIXCOM_init(struct device *dev) {
 
        MOD_INC_USE_COUNT;
        return 0;
+cleanup_filename_channel:
+       remove_proc_entry(FILENAME_CHANNEL, ch->procdir);
+cleanup_filename_irq:
+       remove_proc_entry(FILENAME_IRQ, ch->procdir);
+cleanup_filename_io:
+       remove_proc_entry(FILENAME_IO, ch->procdir);
+cleanup_HW_privdata:
+       kfree(ch->HW_privdata);
+       return -EIO;
 }
 
 static int MIXCOM_exit(struct device *dev)
index 8477071a6a810a40b70f6e36520e143add86d7b9..00d247f96dcd4ed3081252cc4f38568bb7d4d095 100644 (file)
@@ -6,6 +6,9 @@
  * Maintainer: Gergely Madarasz <gorgo@itc.hu>
  *
  * Copyright (C) 1998-1999 ITConsult-Pro Co. <info@itc.hu>
+ * 
+ * Contributors:
+ * Arnaldo Carvalho de Melo <acme@conectiva.com.br> (0.73)
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * Version 0.72 (99/07/09):
  *             - handle slave tbusy with master tbusy (should be fixed)
  *             - fix the keepalive timer addition/deletion
+ * Version 0.73 (00/08/15)
+ *             - resource release on failure at fr_master_init and
+ *               fr_slave_init                   
  */
 
-#define VERSION "0.72"
+#define VERSION "0.73"
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -804,8 +810,9 @@ static int fr_master_init(struct device *dev)
 
        if ((new_file = create_proc_entry(FILENAME_DLCI, S_IFREG | 0644, 
            ch->procdir)) == NULL) {
-               return -ENOMEM;
+               goto cleanup_LINE_privdata;
        }
+
        new_file->data = (void *)new_file;
        new_file->read_proc = &fr_read_proc;
        new_file->write_proc = &fr_write_proc;
@@ -815,8 +822,9 @@ static int fr_master_init(struct device *dev)
 
        if ((new_file = create_proc_entry(FILENAME_KEEPALIVE, S_IFREG | 0644, 
            ch->procdir)) == NULL) {
-               return -ENOMEM;
+               goto cleanup_filename_dlci;
        }
+
        new_file->data = (void *)new_file;
        new_file->read_proc = &fr_read_proc;
        new_file->write_proc = &fr_write_proc;
@@ -828,6 +836,11 @@ static int fr_master_init(struct device *dev)
 
        MOD_INC_USE_COUNT;
        return 0;
+cleanup_filename_dlci:
+        remove_proc_entry(FILENAME_DLCI, ch->procdir);
+cleanup_LINE_privdata:
+       kfree(fr);
+       return -EIO;
 }
 
 static int fr_slave_init(struct device *dev)
@@ -860,7 +873,7 @@ static int fr_slave_init(struct device *dev)
 
        if ((new_file = create_proc_entry(FILENAME_DLCI, S_IFREG | 0644, 
            ch->procdir)) == NULL) {
-               return -ENOMEM;
+               goto cleanup_LINE_privdata;
        }
        
        new_file->data = (void *)new_file;
@@ -872,8 +885,9 @@ static int fr_slave_init(struct device *dev)
 
        if ((new_file = create_proc_entry(FILENAME_MASTER, S_IFREG | 0644, 
            ch->procdir)) == NULL) {
-               return -EIO;
+               goto cleanup_filename_dlci;
        }
+
        new_file->data = (void *)new_file;
        new_file->read_proc = &fr_read_proc;
        new_file->write_proc = &fr_write_proc;
@@ -882,6 +896,11 @@ static int fr_slave_init(struct device *dev)
        new_file->nlink = 1;
        MOD_INC_USE_COUNT;
        return 0;
+cleanup_filename_dlci:
+         remove_proc_entry(FILENAME_DLCI, ch->procdir);
+cleanup_LINE_privdata:
+       kfree(fr);
+       return -EIO;
 }
 
 static int dlci_open(struct device *dev)
index d512c3de92d35d18945a347c93b97c3a9162687b..b2831ecbfa2c257503d16a9c2b7ff29487a70e4c 100644 (file)
@@ -206,6 +206,9 @@ static int syncppp_init(struct device *dev)
 
        ch->LINE_privdata = kmalloc(sizeof(struct syncppp_data), GFP_KERNEL);
 
+       if (!ch->LINE_privdata)
+               return -ENOMEM;
+
        pppdev->dev = dev;
        sppp_attach(pppdev);
 
index b322495092359f39e6b2b53eb09015959182d334..7b3146949adf7b59a2dc2cd1643c00dfebabc582 100644 (file)
@@ -10,6 +10,9 @@
  *
  * Copyright (C) 1995-1999 ITConsult-Pro Co.
  *
+ * Contributors:
+ * Arnaldo Carvalho de Melo <acme@conectiva.com.br> (0.85)
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version
  * Version 0.84 (99/12/01):
  *             - comx_status should not check for IFF_UP (to report
  *               line status from dev->open())
+ * Version 0.85 (00/08/15):
+ *             - resource release on failure in comx_mkdir
+ *             - fix return value on failure at comx_write_proc
  */
 
-#define VERSION "0.84"
+#define VERSION "0.85"
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -521,6 +527,7 @@ static int comx_init_dev(struct device *dev)
        ch->loadavg_size = ch->loadavg[2] / ch->loadavg[0] + 1; 
        if ((ch->avg_bytes = kmalloc(ch->loadavg_size * 
                sizeof(unsigned long) * 2, GFP_KERNEL)) == NULL) {
+               kfree(ch);
                return -ENOMEM;
        }
 
@@ -649,7 +656,7 @@ static int comx_write_proc(struct file *file, const char *buffer, u_long count,
                        ch->debug_start = ch->debug_end = 0;
                        restore_flags(flags);
                        free_page((unsigned long)page);
-                       return count;
+                       return ret ? ret : count;
                }
                
                if (*page != '+' && *page != '-') {
@@ -852,12 +859,18 @@ static int comx_mkdir(struct inode *dir, struct dentry *dentry, int mode)
        struct proc_dir_entry *new_dir, *debug_file;
        struct device *dev;
        struct comx_channel *ch;
+       int ret = -EIO;
 
        if (dir->i_ino != comx_root_dir.low_ino) return -ENOTDIR;
 
+       if ((dev = kmalloc(sizeof(struct device), GFP_KERNEL)) == NULL) {
+               return -ENOMEM;
+       }
+       memset(dev, 0, sizeof(struct device));
+
        if ((new_dir = create_proc_entry(dentry->d_name.name, mode | S_IFDIR, 
                &comx_root_dir)) == NULL) {
-               return -EIO;
+               goto cleanup_dev;
        }
 
        new_dir->ops = &proc_dir_inode_operations;  // ez egy normalis /proc konyvtar
@@ -867,22 +880,22 @@ static int comx_mkdir(struct inode *dir, struct dentry *dentry, int mode)
        /* Ezek kellenek */
        if (!create_comx_proc_entry(FILENAME_HARDWARE, 0644, 
            strlen(HWNAME_NONE) + 1, new_dir)) {
-               return -ENOMEM;
+               goto cleanup_new_dir;
        }
        if (!create_comx_proc_entry(FILENAME_PROTOCOL, 0644, 
            strlen(PROTONAME_NONE) + 1, new_dir)) {
-               return -ENOMEM;
+               goto cleanup_filename_hardware;
        }
        if (!create_comx_proc_entry(FILENAME_STATUS, 0444, 0, new_dir)) {
-               return -ENOMEM;
+               goto cleanup_filename_protocol;
        }
        if (!create_comx_proc_entry(FILENAME_LINEUPDELAY, 0644, 2, new_dir)) {
-               return -ENOMEM;
+               goto cleanup_filename_status;
        }
 
        if ((debug_file = create_proc_entry(FILENAME_DEBUG, 
            S_IFREG | 0644, new_dir)) == NULL) {
-               return -ENOMEM;
+               goto cleanup_filename_lineupdelay;
        }
        debug_file->ops = &comx_debug_inode_ops;
        debug_file->data = (void *)debug_file; 
@@ -890,20 +903,17 @@ static int comx_mkdir(struct inode *dir, struct dentry *dentry, int mode)
        debug_file->write_proc = &comx_write_proc;
        debug_file->nlink = 1;
 
-       if ((dev = kmalloc(sizeof(struct device), GFP_KERNEL)) == NULL) {
-               return -ENOMEM;
-       }
-       memset(dev, 0, sizeof(struct device));
        dev->name = (char *)new_dir->name;
        dev->init = comx_init_dev;
 
        if (register_netdevice(dev)) {
-               return -EIO;
+               goto cleanup_filename_debug;
        }
        ch=dev->priv;
        if((ch->if_ptr = (void *)kmalloc(sizeof(struct ppp_device),
                                 GFP_KERNEL)) == NULL) {
-               return -ENOMEM;
+               ret = -ENOMEM;
+               goto cleanup_register;
        }
        memset(ch->if_ptr, 0, sizeof(struct ppp_device));
        ch->debug_file = debug_file; 
@@ -913,13 +923,33 @@ static int comx_mkdir(struct inode *dir, struct dentry *dentry, int mode)
        ch->debug_start = ch->debug_end = 0;
        if ((ch->debug_area = kmalloc(ch->debug_size = DEFAULT_DEBUG_SIZE, 
            GFP_KERNEL)) == NULL) {
-               return -ENOMEM;
+               ret = -ENOMEM;
+               goto cleanup_if_ptr;
        }
 
        ch->lineup_delay = DEFAULT_LINEUP_DELAY;
 
        MOD_INC_USE_COUNT;
        return 0;
+cleanup_if_ptr:
+       kfree(ch->if_ptr);
+cleanup_register:
+       unregister_netdevice(dev);
+cleanup_filename_debug:
+       remove_proc_entry(FILENAME_DEBUG, new_dir);
+cleanup_filename_lineupdelay:
+       remove_proc_entry(FILENAME_LINEUPDELAY, new_dir);
+cleanup_filename_status:
+       remove_proc_entry(FILENAME_STATUS, new_dir);
+cleanup_filename_protocol:
+       remove_proc_entry(FILENAME_PROTOCOL, new_dir);
+cleanup_filename_hardware:
+       remove_proc_entry(FILENAME_HARDWARE, new_dir);
+cleanup_new_dir:
+       remove_proc_entry(dentry->d_name.name, &comx_root_dir);
+cleanup_dev:
+       kfree(dev);
+       return ret;
 }
 
 static int comx_rmdir(struct inode *dir, struct dentry *dentry)
index 73470945c3172d83b19dc076be514fd701afad4d..74ea6b8bcb5763bde6347f2011aafcb27b50c7fa 100644 (file)
@@ -203,7 +203,7 @@ typedef struct {
 #define MD2_NRZI      0x20     /* NRZI mode */
 #define MD2_LOOPBACK  0x03      /* Local data Loopback */
 
-#define CTL_RTS              0x01
+#define CTL_NORTS     0x01
 #define CTL_IDLE      0x10     /* Transmit an idle pattern */
 #define CTL_UDRNC     0x20     /* Idle after CRC or FCS+flag transmition */
 
index dded82178c6b289a5c5fbc25f84dcea4cbee5af8..1584cc9337d350f820ab0382a8c08a1da76aac8a 100644 (file)
@@ -308,6 +308,7 @@ static struct sv11_device *sv11_init(int iobase, int irq)
        if(z8530_init(dev)!=0)
        {
                printk(KERN_ERR "Z8530 series device not found.\n");
+               restore_flags(flags);
                goto dmafail2;
        }
        z8530_channel_load(&dev->chanB, z8530_dead_port);
index 007957df83d4c7912cfe5764a959bf165acc7a1d..35f59c2a61095445e332633e3f5d943d93059965 100644 (file)
 /* NS8390 NIC (network interface controller) clone, 16 or 64K on-board RAM  */
 /* and 10BASE-2 (thin coax) and AUI connectors.                             */
 
+/* Changes:                                                                */
+/* Arnaldo Carvalho de Melo <acme@conectiva.com.br> - 08/15/2000           */
+/* - check resource allocation in hydra_probe                              */
+
 
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -183,6 +187,10 @@ __initfunc(int hydra_probe(struct device *dev))
                        init_etherdev(dev, 0);
            
                        dev->priv = kmalloc(sizeof(struct hydra_private), GFP_KERNEL);
+
+                       if (!dev->priv)
+                               return -ENOMEM;
+
                        priv = (struct hydra_private *)dev->priv;
                        memset(priv, 0, sizeof(struct hydra_private));
            
index 1b494ccb884693f640833877fd215a1f790fd7aa..a14872043916e970d3c5036329d525722196062d 100644 (file)
@@ -124,10 +124,10 @@ typedef struct card_s {
 
 #define sca_reg(reg, card) (0x8000 | (card)->io | \
                            ((reg)&0x0F) | (((reg)&0xF0) << 6))
-#define sca_in(reg, card)              readb(sca_reg(reg, card))
-#define sca_out(value, reg, card)      writeb(value, sca_reg(reg, card))
-#define sca_inw(reg, card)             readw(sca_reg(reg, card))
-#define sca_outw(value, reg, card)     writew(value, sca_reg(reg, card))
+#define sca_in(reg, card)              inb(sca_reg(reg, card))
+#define sca_out(value, reg, card)      outb(value, sca_reg(reg, card))
+#define sca_inw(reg, card)             inw(sca_reg(reg, card))
+#define sca_outw(value, reg, card)     outw(value, sca_reg(reg, card))
 
 #define port_to_card(port)             ((port)->card)
 #define log_node(port)                 ((port)->log_node)
@@ -163,9 +163,9 @@ static __inline__ int set_clock(port_t *port, int clock)
        u8 mcr = inb(io+N2_MCR);
   
        if (clock == LINE_EXT_CLOCK) /* External clock */
-               mcr |= port->phy_node ? CLOCK_OUT_PORT1 : CLOCK_OUT_PORT0;
-       else
                mcr &= port->phy_node ? ~CLOCK_OUT_PORT1 : ~CLOCK_OUT_PORT0;
+       else
+               mcr |= port->phy_node ? CLOCK_OUT_PORT1 : CLOCK_OUT_PORT0;
 
        outb(mcr, io+N2_MCR);
        port->clkmode = clock;
index 3fc11ff19ce450060f4c68a4a60811d353d344da..122de5cb4fc463bbbae48d644f7d8c3e5e65b2d8 100644 (file)
@@ -325,6 +325,7 @@ static struct slvl_board *slvl_init(int iobase, int irq, int txdma, int rxdma, i
        if(z8530_init(dev)!=0)
        {
                printk(KERN_ERR "Z8530 series device not found.\n");
+               restore_flags(flags);
                goto dmafail2;
        }
        if(dev->type==Z85C30)
index dd879d7019bb118bbe7a8fb1576373fbd7ca3efd..b178afa20ee8fe32dd44e296e15ba79d944206af 100644 (file)
@@ -535,6 +535,7 @@ int ac97_probe_codec(struct ac97_codec *codec)
        /* We need a codec->codec_reset() function here but the delay is a
           reasonable hack for the moment */
           
+       current->state = TASK_UNINTERRUPTIBLE;
        schedule_timeout((5*HZ)/100);
        if ((audio = codec->codec_read(codec, AC97_RESET)) & 0x8000) {
                printk(KERN_ERR "ac97_codec: %s ac97 codec not present\n",
index 5bb4d8f82035dbf25a2cf004b5ead5521e4fa74a..203aca20279a34234b037cdebdda32f8654d93cc 100644 (file)
@@ -864,7 +864,7 @@ static void cs_record_interrupt(struct cs_state *state)
        memcpy(state->dmabuf.rawbuf + (2048*state->dmabuf.pringbuf++),
                state->dmabuf.pbuf+2048*state->dmabuf.ppingbuf++, 2048);
        state->dmabuf.ppingbuf&=1;
-       if(state->dmabuf.pringbuf > (PAGE_SIZE<<state->dmabuf.buforder)/2048)
+       if(state->dmabuf.pringbuf >= (PAGE_SIZE<<state->dmabuf.buforder)/2048)
                state->dmabuf.pringbuf=0;
        cs_update_ptr(state);
 }
@@ -1812,10 +1812,35 @@ static u16 cs_ac97_get(struct ac97_codec *dev, u8 reg)
        return cs461x_peekBA0(card, BA0_ACSDA);
 }
 
+/*
+ *     Do we have the CD potentially enabled either left or right ?
+ */
+static int cd_active(int r)
+{
+       int l=(r>>8)&0x7;
+       r&=7;
+       if(l==1 || r==1)
+               return 1;               /* CD input */
+       if(l==5 || r==5)
+               return 1;               /* Mixer input */
+       if(l==6 || r==6)
+               return 1;               /* Mixer 16bit input */
+       return 0;
+}
+
 static void cs_ac97_set(struct ac97_codec *dev, u8 reg, u16 val)
 {
        struct cs_card *card = dev->private_data;
        int count;
+       int val2;
+       int val3;
+       
+       if(reg==AC97_RECORD_SELECT || reg == AC97_CD_VOL)
+       {
+               val2 = cs_ac97_get(dev, AC97_RECORD_SELECT);
+               val3 = cs_ac97_get(dev, AC97_CD_VOL);
+       }
        
        /*
         *  1. Write ACCAD = Command Address Register = 46Ch for AC97 register address
@@ -1858,6 +1883,51 @@ static void cs_ac97_set(struct ac97_codec *dev, u8 reg, u16 val)
         */
        if (cs461x_peekBA0(card, BA0_ACCTL) & ACCTL_DCV)
                printk(KERN_WARNING "cs461x: AC'97 write problem, reg = 0x%x, val = 0x%x\n", reg, val);
+
+       /*
+        *      Adjust power if the mixer is selected/deselected according
+        *      to the CD.
+        *
+        *      IF the CD is a valid input source (mixer or direct) AND
+        *              the CD is not muted THEN power is needed
+        *
+        *      We do two things. When record select changes the input to
+        *      add/remove the CD we adjust the power count if the CD is
+        *      unmuted.
+        *
+        *      When the CD mute changes we adjust the power level if the
+        *      CD was a valid input.
+        */
+        
+       if(reg==AC97_RECORD_SELECT && cd_active(val)!=cd_active(val2))
+       {
+               int n=-1;
+               /* If we are turning on the port and it is not muted then
+                  bump the power level. If we are turning it off and its
+                  not muted drop the power level */
+               if(cd_active(val))
+                       n=1;
+               if(!(val3 & 0x8000))
+                       card->amplifier_ctrl(card, n);
+       }
+       
+       /* CD mute change ? */
+       
+       if(reg==AC97_CD_VOL)
+       {
+               if(cd_active(val2))
+               {
+                       /* Mute bit change ? */
+                       if((val3^val)&0x8000)
+                       {
+                               /* Mute on */
+                               if(val&0x8000)
+                                       card->amplifier_ctrl(card, -1);
+                               else /* Mute off power on */
+                                       card->amplifier_ctrl(card, 1);
+                       }
+               }
+       }
 }
 
 
@@ -1955,7 +2025,12 @@ static int __init cs_ac97_init(struct cs_card *card)
                }
                
                card->ac97_features = eid;
-                               
+                       
+               /* If the card has the CD enabled then bump the power to
+                  account for it */
+                       
+               if(cd_active(cs_ac97_get(codec, AC97_RECORD_SELECT)))
+                       card->amplifier_ctrl(card, 1);
                        
                if ((codec->dev_mixer = register_sound_mixer(&cs_mixer_fops, -1)) < 0) {
                        printk(KERN_ERR "cs461x: couldn't register mixer!\n");
index ccc5e2a2753afc50d2aae6039e47ff07792e5f28..201c62b47eec762d17f98bf238b99e6d0cda3dc8 100644 (file)
@@ -494,7 +494,7 @@ static u_long get_line_length(int xres_virtual, int bpp)
 {
     u_long length;
     
-    length = (xres_virtual+bpp-1)/bpp;
+    length = xres_virtual*bpp;
     length = (length+31)&-32;
     length >>= 3;
     return(length);
index 3b8c00bc5bba2a9f3dedc1aeb91de1ec96be7dbd..d9a45530e651bf4abb36c94f1b1ba683987e5c0f 100644 (file)
@@ -104,6 +104,8 @@ extern __inline__ unsigned long find_next_zero_bit(void * addr,
        tmp = *p;
 found_first:
        tmp |= ~0UL << size;
+       if (tmp == ~0UL)        /* Are any bits zero? */
+               return result + size; /* Nope. */
 found_middle:
        return result + ffz(tmp);
 }
@@ -194,6 +196,8 @@ extern __inline__ unsigned long ext2_find_next_zero_bit(void *addr,
        tmp = cpu_to_le32p(p);
 found_first:
        tmp |= ~0U << size;
+       if (tmp == ~0UL)        /* Are any bits zero? */
+               return result + size; /* Nope. */
 found_middle:
        return result + ffz(tmp);
 }
index 68c2a0e537c14c787ed0aa966d974110200a166d..a3b799e0ffc0c8ce9e814e2363d6e06101a27cf3 100644 (file)
@@ -52,6 +52,7 @@ extern __inline__ void __restore_flags(unsigned long flags)
         }
 }
 
+struct task_struct;
 
 extern void __sti(void);
 extern void __cli(void);
@@ -82,7 +83,6 @@ void chrp_event_scan(void);
 struct device_node;
 extern void note_scsi_host(struct device_node *, void *);
 
-struct task_struct;
 #define switch_to(prev,next,last) _switch_to((prev),(next),&(last))
 extern void _switch_to(struct task_struct *, struct task_struct *,
                       struct task_struct **);
index 00ddc74544223262cd773c8dc61da327a17058f5..264c72d7a83e35b0c606790bd9c9e70465e6db23 100644 (file)
@@ -340,6 +340,7 @@ EXPORT_SYMBOL(xtime);
 EXPORT_SYMBOL(do_gettimeofday);
 EXPORT_SYMBOL(loops_per_sec);
 EXPORT_SYMBOL(kstat);
+EXPORT_SYMBOL(pidhash); 
 
 /* misc */
 EXPORT_SYMBOL(panic);
@@ -425,3 +426,10 @@ EXPORT_SYMBOL(strnicmp);
 /* init task, for moving kthread roots - ought to export a function ?? */
 EXPORT_SYMBOL(init_task_union);
 
+/* Support for external backtracer */ 
+extern char _stext[], _etext[];
+EXPORT_SYMBOL(_stext);
+EXPORT_SYMBOL(_etext); 
+EXPORT_SYMBOL(module_list); 
+
+
index 8ec2d6024bd17330aba4c92fe86d708537cb9916..34d61d2314ab5afca3eeb62b69510d115359a0eb 100644 (file)
@@ -8,7 +8,7 @@
  * Created at:    Sun May 31 10:12:43 1998
  * Modified at:   Tue Apr 11 19:06:24 2000
  * Modified by:   Dag Brattli <dagb@cs.uit.no>
- * Sources:       af_netroom.c, af_ax25.c, af_rose.c, af_x25.c etc.
+ * Sources:       af_netrom.c, af_ax25.c, af_rose.c, af_x25.c etc.
  * 
  *     Copyright (c) 1999-2000 Dag Brattli <dagb@cs.uit.no>
  *     Copyright (c) 1999 Jean Tourrilhes <jeant@rockfort.hpl.hp.com>
@@ -1074,7 +1074,6 @@ static int irda_release(struct socket *sock, struct socket *peer)
         sock->sk   = NULL;      
         sk->socket = NULL;      /* Not used, but we should do this. */
        sk->protinfo.irda = NULL;
-       sock_put(sk);
         return 0;
 }
 
index 2fe3d22dd3dc2b11fbe7634d26db500ad42518df..1ef4818e554aa1e30f41f320b9af5093cd673d0b 100644 (file)
@@ -513,10 +513,7 @@ int irda_param_extract(void *self, __u8 *buf, int len, pi_param_info_t *info)
                      buf[0]);
                
                /* Skip this parameter */
-               n += (2 + buf[n+1]);
-               len -= (2 + buf[n+1]);
-
-               return 0;  /* Continue */
+               return 2 + buf[n + 1];  /* Continue */
        }
 
        /* Lookup the info on how to parse this parameter */
@@ -532,10 +529,7 @@ int irda_param_extract(void *self, __u8 *buf, int len, pi_param_info_t *info)
        if (!pi_minor_info->func) {
                MESSAGE(__FUNCTION__"(), no handler for pi=%#x\n", buf[n]);
                /* Skip this parameter */
-               n += (2 + buf[n+1]);
-               len -= (2 + buf[n+1]);
-
-               return 0; /* Continue */
+               return 2 + buf[n + 1]; /* Continue */
        }
 
        /* Parse parameter value */
index eaaf85640fee8800b60dbd6524b4105633733d2e..3ca2e673ae1493834edd5bca4f008744f4a302d8 100644 (file)
@@ -445,16 +445,16 @@ __rpc_execute(struct rpc_task *task)
                        if (current->pid == rpciod_pid)
                                printk(KERN_ERR "RPC: rpciod waiting on sync task!\n");
 
-                       sti();
                        __wait_event(task->tk_wait, RPC_IS_RUNNING(task));
-                       cli();
 
                        /*
                         * When the task received a signal, remove from
                         * any queues etc, and make runnable again.
                         */
-                       if (signalled())
+                       if (signalled()) { 
+                               cli(); 
                                __rpc_wake_up(task);
+                       }
 
                        dprintk("RPC: %4d sync task resuming\n",
                                                        task->tk_pid);