## Automatically generated incremental diff
## From:   linux-2.2.17-pre17
## To:     linux-2.2.17-pre18
## Robot:  $Id: make-incremental-diff,v 1.8 2001/12/04 06:05:04 hpa Exp $

diff -urN linux-2.2.17-pre17/Makefile linux/Makefile
--- linux-2.2.17-pre17/Makefile	Mon Dec  3 22:11:22 2001
+++ linux/Makefile	Mon Dec  3 22:11:28 2001
@@ -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/)
 
diff -urN linux-2.2.17-pre17/arch/ppc/kernel/head.S linux/arch/ppc/kernel/head.S
--- linux-2.2.17-pre17/arch/ppc/kernel/head.S	Mon Dec  3 22:11:22 2001
+++ linux/arch/ppc/kernel/head.S	Mon Dec  3 22:11:28 2001
@@ -1829,14 +1829,12 @@
  	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 @@
 	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
diff -urN linux-2.2.17-pre17/arch/ppc/kernel/misc.S linux/arch/ppc/kernel/misc.S
--- linux-2.2.17-pre17/arch/ppc/kernel/misc.S	Mon Dec  3 22:11:22 2001
+++ linux/arch/ppc/kernel/misc.S	Mon Dec  3 22:11:28 2001
@@ -275,10 +275,8 @@
 	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 @@
 	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 */
diff -urN linux-2.2.17-pre17/drivers/block/ide-cd.c linux/drivers/block/ide-cd.c
--- linux-2.2.17-pre17/drivers/block/ide-cd.c	Mon Dec  3 22:11:22 2001
+++ linux/drivers/block/ide-cd.c	Mon Dec  3 22:11:28 2001
@@ -2391,7 +2391,9 @@
 	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;
diff -urN linux-2.2.17-pre17/drivers/macintosh/macserial.c linux/drivers/macintosh/macserial.c
--- linux-2.2.17-pre17/drivers/macintosh/macserial.c	Mon Dec  3 22:11:22 2001
+++ linux/drivers/macintosh/macserial.c	Mon Dec  3 22:11:28 2001
@@ -2295,7 +2295,7 @@
 	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;
diff -urN linux-2.2.17-pre17/drivers/net/3c59x.c linux/drivers/net/3c59x.c
--- linux-2.2.17-pre17/drivers/net/3c59x.c	Mon Dec  3 22:11:22 2001
+++ linux/drivers/net/3c59x.c	Mon Dec  3 22:11:28 2001
@@ -637,6 +637,8 @@
 	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 @@
 	/* 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;
 	}
diff -urN linux-2.2.17-pre17/drivers/net/arlan.c linux/drivers/net/arlan.c
--- linux-2.2.17-pre17/drivers/net/arlan.c	Wed May  3 17:16:40 2000
+++ linux/drivers/net/arlan.c	Mon Dec  3 22:11:28 2001
@@ -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 @@
 		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 @@
 	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 @@
 	}
 	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;
 		}
diff -urN linux-2.2.17-pre17/drivers/net/bonding.c linux/drivers/net/bonding.c
--- linux-2.2.17-pre17/drivers/net/bonding.c	Mon Dec  3 22:11:22 2001
+++ linux/drivers/net/bonding.c	Mon Dec  3 22:11:28 2001
@@ -28,6 +28,10 @@
  *
  * 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 @@
 		slave=next;
 		queue->num_slaves--;
 	}
-
+	queue->head = NULL;
+	
 	restore_flags(flags);
 
 	MOD_DEC_USE_COUNT;
@@ -210,14 +215,19 @@
 	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));
 
diff -urN linux-2.2.17-pre17/drivers/net/c101.c linux/drivers/net/c101.c
--- linux-2.2.17-pre17/drivers/net/c101.c	Mon Dec  3 22:11:22 2001
+++ linux/drivers/net/c101.c	Mon Dec  3 22:11:28 2001
@@ -117,12 +117,14 @@
 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);
 }
 
 
diff -urN linux-2.2.17-pre17/drivers/net/com20020.c linux/drivers/net/com20020.c
--- linux-2.2.17-pre17/drivers/net/com20020.c	Mon Sep 14 11:32:22 1998
+++ linux/drivers/net/com20020.c	Mon Dec  3 22:11:28 2001
@@ -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 @@
 
   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);
diff -urN linux-2.2.17-pre17/drivers/net/com90io.c linux/drivers/net/com90io.c
--- linux-2.2.17-pre17/drivers/net/com90io.c	Mon Sep 14 11:32:22 1998
+++ linux/drivers/net/com90io.c	Mon Dec  3 22:11:28 2001
@@ -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 @@
 
   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);
diff -urN linux-2.2.17-pre17/drivers/net/comx-hw-comx.c linux/drivers/net/comx-hw-comx.c
--- linux-2.2.17-pre17/drivers/net/comx-hw-comx.c	Wed May  3 17:16:40 2000
+++ linux/drivers/net/comx-hw-comx.c	Mon Dec  3 22:11:28 2001
@@ -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
@@ -37,9 +40,11 @@
  * 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 @@
 
 	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 @@
 
 	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 @@
 
 	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 @@
 	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 @@
 
 	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 @@
 
 	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 @@
 
 	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 @@
 
 	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 */
diff -urN linux-2.2.17-pre17/drivers/net/comx-hw-locomx.c linux/drivers/net/comx-hw-locomx.c
--- linux-2.2.17-pre17/drivers/net/comx-hw-locomx.c	Tue Jan  4 10:12:17 2000
+++ linux/drivers/net/comx-hw-locomx.c	Mon Dec  3 22:11:28 2001
@@ -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
@@ -27,9 +30,11 @@
  * 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 @@
 	/* 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 @@
 
 	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 @@
 	/* 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;
 }
 
 
diff -urN linux-2.2.17-pre17/drivers/net/comx-hw-mixcom.c linux/drivers/net/comx-hw-mixcom.c
--- linux-2.2.17-pre17/drivers/net/comx-hw-mixcom.c	Wed May  3 17:16:40 2000
+++ linux/drivers/net/comx-hw-mixcom.c	Mon Dec  3 22:11:28 2001
@@ -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
@@ -29,9 +32,12 @@
  *
  * 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 @@
 
 	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 @@
 
 	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 @@
 
 	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 @@
 
 	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 @@
 
 	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)
diff -urN linux-2.2.17-pre17/drivers/net/comx-proto-fr.c linux/drivers/net/comx-proto-fr.c
--- linux-2.2.17-pre17/drivers/net/comx-proto-fr.c	Tue Jan  4 10:12:17 2000
+++ linux/drivers/net/comx-proto-fr.c	Mon Dec  3 22:11:28 2001
@@ -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
@@ -25,9 +28,12 @@
  * 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 @@
 
 	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 @@
 
 	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 @@
 
 	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 @@
 
 	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 @@
 
 	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 @@
 	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)
diff -urN linux-2.2.17-pre17/drivers/net/comx-proto-ppp.c linux/drivers/net/comx-proto-ppp.c
--- linux-2.2.17-pre17/drivers/net/comx-proto-ppp.c	Wed Jun  7 14:26:43 2000
+++ linux/drivers/net/comx-proto-ppp.c	Mon Dec  3 22:11:28 2001
@@ -206,6 +206,9 @@
 
 	ch->LINE_privdata = kmalloc(sizeof(struct syncppp_data), GFP_KERNEL);
 
+	if (!ch->LINE_privdata)
+		return -ENOMEM;
+
 	pppdev->dev = dev;
 	sppp_attach(pppdev);
 
diff -urN linux-2.2.17-pre17/drivers/net/comx.c linux/drivers/net/comx.c
--- linux-2.2.17-pre17/drivers/net/comx.c	Wed Jun  7 14:26:43 2000
+++ linux/drivers/net/comx.c	Mon Dec  3 22:11:28 2001
@@ -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
@@ -39,9 +42,12 @@
  * 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 @@
 	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 @@
 			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 @@
 	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 @@
 	/* 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 @@
 	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 @@
 	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)
diff -urN linux-2.2.17-pre17/drivers/net/hd64570.h linux/drivers/net/hd64570.h
--- linux-2.2.17-pre17/drivers/net/hd64570.h	Wed Jun  7 14:26:43 2000
+++ linux/drivers/net/hd64570.h	Mon Dec  3 22:11:29 2001
@@ -203,7 +203,7 @@
 #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 */
 
diff -urN linux-2.2.17-pre17/drivers/net/hostess_sv11.c linux/drivers/net/hostess_sv11.c
--- linux-2.2.17-pre17/drivers/net/hostess_sv11.c	Wed Jun  7 14:26:43 2000
+++ linux/drivers/net/hostess_sv11.c	Mon Dec  3 22:11:29 2001
@@ -308,6 +308,7 @@
 	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);
diff -urN linux-2.2.17-pre17/drivers/net/hydra.c linux/drivers/net/hydra.c
--- linux-2.2.17-pre17/drivers/net/hydra.c	Mon Dec  3 22:11:22 2001
+++ linux/drivers/net/hydra.c	Mon Dec  3 22:11:29 2001
@@ -14,6 +14,10 @@
 /* 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 @@
 			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));
 	    
diff -urN linux-2.2.17-pre17/drivers/net/n2.c linux/drivers/net/n2.c
--- linux-2.2.17-pre17/drivers/net/n2.c	Mon Dec  3 22:11:22 2001
+++ linux/drivers/net/n2.c	Mon Dec  3 22:11:29 2001
@@ -124,10 +124,10 @@
 
 #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 @@
 	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;
diff -urN linux-2.2.17-pre17/drivers/net/sealevel.c linux/drivers/net/sealevel.c
--- linux-2.2.17-pre17/drivers/net/sealevel.c	Wed Jun  7 14:26:43 2000
+++ linux/drivers/net/sealevel.c	Mon Dec  3 22:11:29 2001
@@ -325,6 +325,7 @@
 	if(z8530_init(dev)!=0)
 	{
 		printk(KERN_ERR "Z8530 series device not found.\n");
+		restore_flags(flags);
 		goto dmafail2;
 	}
 	if(dev->type==Z85C30)
diff -urN linux-2.2.17-pre17/drivers/sound/ac97_codec.c linux/drivers/sound/ac97_codec.c
--- linux-2.2.17-pre17/drivers/sound/ac97_codec.c	Mon Dec  3 22:11:22 2001
+++ linux/drivers/sound/ac97_codec.c	Mon Dec  3 22:11:29 2001
@@ -535,6 +535,7 @@
 	/* 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",
diff -urN linux-2.2.17-pre17/drivers/sound/cs46xx.c linux/drivers/sound/cs46xx.c
--- linux-2.2.17-pre17/drivers/sound/cs46xx.c	Mon Dec  3 22:11:22 2001
+++ linux/drivers/sound/cs46xx.c	Mon Dec  3 22:11:29 2001
@@ -864,7 +864,7 @@
 	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 @@
 	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 @@
 	 */
 	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 @@
 		}
 		
 		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");
diff -urN linux-2.2.17-pre17/drivers/video/vfb.c linux/drivers/video/vfb.c
--- linux-2.2.17-pre17/drivers/video/vfb.c	Thu Oct  1 10:02:21 1998
+++ linux/drivers/video/vfb.c	Mon Dec  3 22:11:29 2001
@@ -494,7 +494,7 @@
 {
     u_long length;
     
-    length = (xres_virtual+bpp-1)/bpp;
+    length = xres_virtual*bpp;
     length = (length+31)&-32;
     length >>= 3;
     return(length);
diff -urN linux-2.2.17-pre17/include/asm-ppc/bitops.h linux/include/asm-ppc/bitops.h
--- linux-2.2.17-pre17/include/asm-ppc/bitops.h	Wed May  3 17:16:50 2000
+++ linux/include/asm-ppc/bitops.h	Mon Dec  3 22:11:29 2001
@@ -104,6 +104,8 @@
 	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 @@
 	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);
 }
diff -urN linux-2.2.17-pre17/include/asm-ppc/system.h linux/include/asm-ppc/system.h
--- linux-2.2.17-pre17/include/asm-ppc/system.h	Mon Dec  3 22:11:23 2001
+++ linux/include/asm-ppc/system.h	Mon Dec  3 22:11:29 2001
@@ -52,6 +52,7 @@
         }
 }
 
+struct task_struct;
 
 extern void __sti(void);
 extern void __cli(void);
@@ -82,7 +83,6 @@
 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 **);
diff -urN linux-2.2.17-pre17/kernel/ksyms.c linux/kernel/ksyms.c
--- linux-2.2.17-pre17/kernel/ksyms.c	Mon Dec  3 22:11:23 2001
+++ linux/kernel/ksyms.c	Mon Dec  3 22:11:29 2001
@@ -340,6 +340,7 @@
 EXPORT_SYMBOL(do_gettimeofday);
 EXPORT_SYMBOL(loops_per_sec);
 EXPORT_SYMBOL(kstat);
+EXPORT_SYMBOL(pidhash); 
 
 /* misc */
 EXPORT_SYMBOL(panic);
@@ -424,4 +425,11 @@
 
 /* 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); 
+
 
diff -urN linux-2.2.17-pre17/net/irda/af_irda.c linux/net/irda/af_irda.c
--- linux-2.2.17-pre17/net/irda/af_irda.c	Mon Dec  3 22:11:23 2001
+++ linux/net/irda/af_irda.c	Mon Dec  3 22:11:29 2001
@@ -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 @@
         sock->sk   = NULL;      
         sk->socket = NULL;      /* Not used, but we should do this. */
 	sk->protinfo.irda = NULL;
-	sock_put(sk);
         return 0;
 }
 
diff -urN linux-2.2.17-pre17/net/irda/parameters.c linux/net/irda/parameters.c
--- linux-2.2.17-pre17/net/irda/parameters.c	Wed May  3 17:16:54 2000
+++ linux/net/irda/parameters.c	Mon Dec  3 22:11:29 2001
@@ -513,10 +513,7 @@
 		      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 @@
 	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 */
diff -urN linux-2.2.17-pre17/net/sunrpc/sched.c linux/net/sunrpc/sched.c
--- linux-2.2.17-pre17/net/sunrpc/sched.c	Wed May  3 17:16:54 2000
+++ linux/net/sunrpc/sched.c	Mon Dec  3 22:11:29 2001
@@ -445,16 +445,16 @@
 			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);
