diff -purN linux-2.4.29-hf11/Makefile linux-2.4.29-hf12/Makefile --- linux-2.4.29-hf11/Makefile Sat Jul 16 23:20:00 2005 +++ linux-2.4.29-hf12/Makefile Sat Jul 16 23:20:00 2005 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 29 -EXTRAVERSION = -hf11 +EXTRAVERSION = -hf12 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) diff -purN linux-2.4.29-hf11/drivers/char/cyclades.c linux-2.4.29-hf12/drivers/char/cyclades.c --- linux-2.4.29-hf11/drivers/char/cyclades.c Wed Dec 22 22:26:14 2004 +++ linux-2.4.29-hf12/drivers/char/cyclades.c Sat Jul 16 23:20:00 2005 @@ -2960,10 +2960,15 @@ static int cy_write(struct tty_struct * tty, int from_user, const unsigned char *buf, int count) { - struct cyclades_port *info = (struct cyclades_port *)tty->driver_data; + struct cyclades_port *info; unsigned long flags; int c, ret = 0; + if (!tty) + return 0; + + info = (struct cyclades_port *)tty->driver_data; + #ifdef CY_DEBUG_IO printk("cyc:cy_write ttyC%d\n", info->line); /* */ #endif @@ -2972,7 +2977,7 @@ cy_write(struct tty_struct * tty, int fr return 0; } - if (!tty || !info->xmit_buf || !tmp_buf){ + if (!info->xmit_buf || !tmp_buf){ return 0; } @@ -3047,9 +3052,14 @@ cy_write(struct tty_struct * tty, int fr static void cy_put_char(struct tty_struct *tty, unsigned char ch) { - struct cyclades_port *info = (struct cyclades_port *)tty->driver_data; + struct cyclades_port *info; unsigned long flags; + if (!tty) + return; + + info = (struct cyclades_port *)tty->driver_data; + #ifdef CY_DEBUG_IO printk("cyc:cy_put_char ttyC%d\n", info->line); #endif @@ -3057,7 +3067,7 @@ cy_put_char(struct tty_struct *tty, unsi if (serial_paranoia_check(info, tty->device, "cy_put_char")) return; - if (!tty || !info->xmit_buf) + if (!info->xmit_buf) return; CY_LOCK(info, flags); diff -purN linux-2.4.29-hf11/drivers/char/esp.c linux-2.4.29-hf12/drivers/char/esp.c --- linux-2.4.29-hf11/drivers/char/esp.c Wed Dec 22 22:26:14 2004 +++ linux-2.4.29-hf12/drivers/char/esp.c Sat Jul 16 23:20:00 2005 @@ -1251,13 +1251,18 @@ static void change_speed(struct esp_stru static void rs_put_char(struct tty_struct *tty, unsigned char ch) { - struct esp_struct *info = (struct esp_struct *)tty->driver_data; + struct esp_struct *info; unsigned long flags; + if (!tty) + return; + + info = (struct esp_struct *)tty->driver_data; + if (serial_paranoia_check(info, tty->device, "rs_put_char")) return; - if (!tty || !info->xmit_buf) + if (!info->xmit_buf) return; save_flags(flags); cli(); @@ -1296,13 +1301,19 @@ static int rs_write(struct tty_struct * const unsigned char *buf, int count) { int c, t, ret = 0; - struct esp_struct *info = (struct esp_struct *)tty->driver_data; + struct esp_struct *info; unsigned long flags; + + if (!tty) + return 0; + + info = (struct esp_struct *)tty->driver_data; + if (serial_paranoia_check(info, tty->device, "rs_write")) return 0; - if (!tty || !info->xmit_buf || !tmp_buf) + if (!info->xmit_buf || !tmp_buf) return 0; if (from_user) diff -purN linux-2.4.29-hf11/drivers/char/isicom.c linux-2.4.29-hf12/drivers/char/isicom.c --- linux-2.4.29-hf11/drivers/char/isicom.c Wed Dec 22 22:26:14 2004 +++ linux-2.4.29-hf12/drivers/char/isicom.c Sat Jul 16 23:20:00 2005 @@ -1223,9 +1223,15 @@ static void isicom_close(struct tty_stru static int isicom_write(struct tty_struct * tty, int from_user, const unsigned char * buf, int count) { - struct isi_port * port = (struct isi_port *) tty->driver_data; + struct isi_port * port; unsigned long flags; int cnt, total = 0; + + if (!tty) + return 0; + + port = (struct isi_port *) tty->driver_data; + #ifdef ISICOM_DEBUG printk(KERN_DEBUG "ISICOM: isicom_write for port%d: %d bytes.\n", port->channel+1, count); @@ -1233,7 +1239,7 @@ static int isicom_write(struct tty_struc if (isicom_paranoia_check(port, tty->device, "isicom_write")) return 0; - if (!tty || !port->xmit_buf || !tmp_buf) + if (!port->xmit_buf || !tmp_buf) return 0; if (from_user) down(&tmp_buf_sem); /* acquire xclusive access to tmp_buf */ @@ -1281,13 +1287,18 @@ static int isicom_write(struct tty_struc /* put_char et all */ static void isicom_put_char(struct tty_struct * tty, unsigned char ch) { - struct isi_port * port = (struct isi_port *) tty->driver_data; + struct isi_port * port; unsigned long flags; + + if (!tty) + return; + + port = (struct isi_port *) tty->driver_data; if (isicom_paranoia_check(port, tty->device, "isicom_put_char")) return; - if (!tty || !port->xmit_buf) + if (!port->xmit_buf) return; #ifdef ISICOM_DEBUG printk(KERN_DEBUG "ISICOM: put_char, port %d, char %c.\n", port->channel+1, ch); diff -purN linux-2.4.29-hf11/drivers/char/mxser.c linux-2.4.29-hf12/drivers/char/mxser.c --- linux-2.4.29-hf11/drivers/char/mxser.c Wed Dec 22 22:26:14 2004 +++ linux-2.4.29-hf12/drivers/char/mxser.c Sat Jul 16 23:20:00 2005 @@ -911,10 +911,15 @@ static int mxser_write(struct tty_struct const unsigned char *buf, int count) { int c, total = 0; - struct mxser_struct *info = (struct mxser_struct *) tty->driver_data; + struct mxser_struct *info; unsigned long flags; - if (!tty || !info->xmit_buf || !mxvar_tmp_buf) + if (!tty) + return (0); + + info = (struct mxser_struct *) tty->driver_data; + + if (!info->xmit_buf || !mxvar_tmp_buf) return (0); save_flags(flags); @@ -979,10 +984,15 @@ static int mxser_write(struct tty_struct static void mxser_put_char(struct tty_struct *tty, unsigned char ch) { - struct mxser_struct *info = (struct mxser_struct *) tty->driver_data; + struct mxser_struct *info; unsigned long flags; - if (!tty || !info->xmit_buf) + if (!tty) + return; + + info = (struct mxser_struct *) tty->driver_data; + + if (!info->xmit_buf) return; save_flags(flags); diff -purN linux-2.4.29-hf11/drivers/char/riscom8.c linux-2.4.29-hf12/drivers/char/riscom8.c --- linux-2.4.29-hf11/drivers/char/riscom8.c Wed Dec 22 22:26:14 2004 +++ linux-2.4.29-hf12/drivers/char/riscom8.c Sat Jul 16 23:20:00 2005 @@ -1220,17 +1220,22 @@ out: restore_flags(flags); static int rc_write(struct tty_struct * tty, int from_user, const unsigned char *buf, int count) { - struct riscom_port *port = (struct riscom_port *)tty->driver_data; + struct riscom_port *port; struct riscom_board *bp; int c, total = 0; unsigned long flags; + + if (!tty) + return 0; + + port = (struct riscom_port *)tty->driver_data; if (rc_paranoia_check(port, tty->device, "rc_write")) return 0; bp = port_Board(port); - if (!tty || !port->xmit_buf || !tmp_buf) + if (!port->xmit_buf || !tmp_buf) return 0; save_flags(flags); @@ -1298,13 +1303,18 @@ static int rc_write(struct tty_struct * static void rc_put_char(struct tty_struct * tty, unsigned char ch) { - struct riscom_port *port = (struct riscom_port *)tty->driver_data; + struct riscom_port *port; unsigned long flags; + if (!tty) + return; + + port = (struct riscom_port *)tty->driver_data; + if (rc_paranoia_check(port, tty->device, "rc_put_char")) return; - if (!tty || !port->xmit_buf) + if (!port->xmit_buf) return; save_flags(flags); cli(); diff -purN linux-2.4.29-hf11/drivers/char/specialix.c linux-2.4.29-hf12/drivers/char/specialix.c --- linux-2.4.29-hf11/drivers/char/specialix.c Wed Dec 22 22:26:14 2004 +++ linux-2.4.29-hf12/drivers/char/specialix.c Sat Jul 16 23:20:00 2005 @@ -1600,17 +1600,22 @@ static void sx_close(struct tty_struct * static int sx_write(struct tty_struct * tty, int from_user, const unsigned char *buf, int count) { - struct specialix_port *port = (struct specialix_port *)tty->driver_data; + struct specialix_port *port; struct specialix_board *bp; int c, total = 0; unsigned long flags; + + if (!tty) + return 0; + + port = (struct specialix_port *)tty->driver_data; if (sx_paranoia_check(port, tty->device, "sx_write")) return 0; bp = port_Board(port); - if (!tty || !port->xmit_buf || !tmp_buf) + if (!port->xmit_buf || !tmp_buf) return 0; save_flags(flags); @@ -1676,13 +1681,18 @@ static int sx_write(struct tty_struct * static void sx_put_char(struct tty_struct * tty, unsigned char ch) { - struct specialix_port *port = (struct specialix_port *)tty->driver_data; + struct specialix_port *port; unsigned long flags; + if (!tty) + return; + + port = (struct specialix_port *)tty->driver_data; + if (sx_paranoia_check(port, tty->device, "sx_put_char")) return; - if (!tty || !port->xmit_buf) + if (!port->xmit_buf) return; save_flags(flags); cli(); diff -purN linux-2.4.29-hf11/net/netlink/af_netlink.c linux-2.4.29-hf12/net/netlink/af_netlink.c --- linux-2.4.29-hf11/net/netlink/af_netlink.c Sat Jul 16 23:20:00 2005 +++ linux-2.4.29-hf12/net/netlink/af_netlink.c Sat Jul 16 23:20:00 2005 @@ -330,9 +330,9 @@ static void netlink_remove(struct sock * u32 pid = nlk_sk(sk)->pid; netlink_table_grab(); + hash->entries--; for (skp = nl_pid_hashfn(hash, pid); *skp; skp = &((*skp)->next)) { if (*skp == sk) { - hash->entries--; *skp = sk->next; __sock_put(sk); break; @@ -450,7 +450,7 @@ retry: err = netlink_insert(sk, pid); if (err == -EADDRINUSE) goto retry; - return err; + return 0; } static inline int netlink_capable(struct socket *sock, unsigned int flag)