diff -Naur affix-kernel-old/btcore/hci.c affix-kernel/btcore/hci.c --- affix-kernel-old/btcore/hci.c 2004-02-20 15:46:54.000000000 +0200 +++ affix-kernel/btcore/hci.c 2005-04-22 14:50:52.000000000 +0300 @@ -2206,7 +2206,7 @@ int affix_sock_register(struct net_proto_family *pf, int protocol) { - if (protocol >= BTPROTO_MAX) + if ((protocol < 0) || (protocol >= BTPROTO_MAX)) return -EINVAL; if (btprotos[protocol]) return -EEXIST; @@ -2227,7 +2227,7 @@ int affix_sock_unregister(int protocol) { - if (protocol >= BTPROTO_MAX) + if ((protocol < 0) || (protocol >= BTPROTO_MAX)) return -EINVAL; btprotos[protocol] = NULL; return 0; @@ -2238,7 +2238,7 @@ int i; DBFENTER; - if (protocol >= BTPROTO_MAX) + if ((protocol < 0) || (protocol >= BTPROTO_MAX)) return -EPROTONOSUPPORT; if (btprotos[protocol] == NULL) { if (protocol == BTPROTO_RFCOMM)