]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/net/ax25.h
[AX.25]: Fix potencial memory hole.
[linux-2.6-omap-h63xx.git] / include / net / ax25.h
index 9dbcd9e51c00a33d1502824929468ce6a9e594c2..d052b221dbcd4b5ce124e9ee3a0c64358a2dbf1d 100644 (file)
@@ -110,8 +110,15 @@ enum {
 enum {
        AX25_PROTO_STD_SIMPLEX,
        AX25_PROTO_STD_DUPLEX,
+#ifdef CONFIG_AX25_DAMA_SLAVE
        AX25_PROTO_DAMA_SLAVE,
-       AX25_PROTO_DAMA_MASTER
+#ifdef CONFIG_AX25_DAMA_MASTER
+       AX25_PROTO_DAMA_MASTER,
+#define AX25_PROTO_MAX AX25_PROTO_DAMA_MASTER
+#endif
+#endif
+       __AX25_PROTO_MAX,
+       AX25_PROTO_MAX = __AX25_PROTO_MAX -1
 };
 
 enum {
@@ -171,7 +178,7 @@ typedef struct {
        ax25_address            calls[AX25_MAX_DIGIS];
        unsigned char           repeated[AX25_MAX_DIGIS];
        unsigned char           ndigi;
-       char                    lastrepeat;
+       signed char             lastrepeat;
 } ax25_digi;
 
 typedef struct ax25_route {
@@ -237,8 +244,7 @@ typedef struct ax25_cb {
 static __inline__ void ax25_cb_put(ax25_cb *ax25)
 {
        if (atomic_dec_and_test(&ax25->refcount)) {
-               if (ax25->digipeat)
-                       kfree(ax25->digipeat);
+               kfree(ax25->digipeat);
                kfree(ax25);
        }
 }