tipc: fix test of bearer_priority range in tipc_register_media()
authorroel kluin <roel.kluin@gmail.com>
Thu, 27 Aug 2009 02:03:15 +0000 (02:03 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 29 Aug 2009 07:19:42 +0000 (00:19 -0700)
For the bearer_priority to be less than TIPC_MIN_LINK_PRI and greater than
TIPC_MAX_LINK_PRI is logically impossible.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/bearer.c

index a7a36779b9b3b87cdf717923b462e0cf25a763b2..327011fcc407941721d0e207f0e69b1f81c2b162 100644 (file)
@@ -119,7 +119,7 @@ int  tipc_register_media(u32 media_type,
                warn("Media <%s> rejected, no broadcast address\n", name);
                goto exit;
        }
-       if ((bearer_priority < TIPC_MIN_LINK_PRI) &&
+       if ((bearer_priority < TIPC_MIN_LINK_PRI) ||
            (bearer_priority > TIPC_MAX_LINK_PRI)) {
                warn("Media <%s> rejected, illegal priority (%u)\n", name,
                     bearer_priority);