Bluetooth: Fix race condition on l2cap_ertm_send()
[safe/jmp/linux-2.6] / include / net / netrom.h
index a5ee53b..f0793c1 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <linux/netrom.h>
 #include <linux/list.h>
+#include <linux/slab.h>
 #include <net/sock.h>
 
 #define        NR_NETWORK_LEN                  15
@@ -42,11 +43,11 @@ enum {
 #define        NR_COND_PEER_RX_BUSY            0x04
 #define        NR_COND_OWN_RX_BUSY             0x08
 
-#define NR_DEFAULT_T1                  (120 * HZ)      /* Outstanding frames - 120 seconds */
-#define NR_DEFAULT_T2                  (5   * HZ)      /* Response delay     - 5 seconds */
+#define NR_DEFAULT_T1                  120000          /* Outstanding frames - 120 seconds */
+#define NR_DEFAULT_T2                  5000            /* Response delay     - 5 seconds */
 #define NR_DEFAULT_N2                  3               /* Number of Retries - 3 */
-#define        NR_DEFAULT_T4                   (180 * HZ)      /* Busy Delay - 180 seconds */
-#define        NR_DEFAULT_IDLE                 (0 * 60 * HZ)   /* No Activity Timeout - none */
+#define        NR_DEFAULT_T4                   180000          /* Busy Delay - 180 seconds */
+#define        NR_DEFAULT_IDLE                 0               /* No Activity Timeout - none */
 #define        NR_DEFAULT_WINDOW               4               /* Default Window Size - 4 */
 #define        NR_DEFAULT_OBS                  6               /* Default Obsolescence Count - 6 */
 #define        NR_DEFAULT_QUAL                 10              /* Default Neighbour Quality - 10 */
@@ -59,10 +60,6 @@ enum {
 #define NR_MAX_WINDOW_SIZE             127                     /* Maximum Window Allowable - 127 */
 #define        NR_MAX_PACKET_SIZE              236                     /* Maximum Packet Length - 236 */
 
-struct nr_private {
-       struct net_device_stats stats;
-};
-
 struct nr_sock {
        struct sock             sock;
        ax25_address            user_addr, source_addr, dest_addr;
@@ -136,6 +133,8 @@ static __inline__ void nr_node_put(struct nr_node *nr_node)
 static __inline__ void nr_neigh_put(struct nr_neigh *nr_neigh)
 {
        if (atomic_dec_and_test(&nr_neigh->refcount)) {
+               if (nr_neigh->ax25)
+                       ax25_cb_put(nr_neigh->ax25);
                kfree(nr_neigh->digipeat);
                kfree(nr_neigh);
        }
@@ -215,8 +214,8 @@ extern struct net_device *nr_dev_get(ax25_address *);
 extern int  nr_rt_ioctl(unsigned int, void __user *);
 extern void nr_link_failed(ax25_cb *, int);
 extern int  nr_route_frame(struct sk_buff *, ax25_cb *);
-extern struct file_operations nr_nodes_fops;
-extern struct file_operations nr_neigh_fops;
+extern const struct file_operations nr_nodes_fops;
+extern const struct file_operations nr_neigh_fops;
 extern void nr_rt_free(void);
 
 /* nr_subr.c */