From patchwork Thu Aug 27 12:03:15 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roel kluin X-Patchwork-Id: 32248 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4782DB7BB6 for ; Thu, 27 Aug 2009 21:58:30 +1000 (EST) Received: by ozlabs.org (Postfix) id 3F383DDD0B; Thu, 27 Aug 2009 21:58:30 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 2F09CDDD04 for ; Thu, 27 Aug 2009 21:58:29 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752018AbZH0L6A (ORCPT ); Thu, 27 Aug 2009 07:58:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751981AbZH0L57 (ORCPT ); Thu, 27 Aug 2009 07:57:59 -0400 Received: from mail-ew0-f206.google.com ([209.85.219.206]:59520 "EHLO mail-ew0-f206.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751975AbZH0L56 (ORCPT ); Thu, 27 Aug 2009 07:57:58 -0400 Received: by ewy2 with SMTP id 2so1108192ewy.17 for ; Thu, 27 Aug 2009 04:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=y43TZMkOIEOEqkafNcf4GBEw9MDpZmV2xMlBEUuF+dI=; b=i0LgfTX9Ena2rdGl3rC0u+fD+q8cq/AigO2W6KpE+64k1HMHQcUNBbE8j9DD7fDyLv m7HKT+zVI7ptCXtyG1JcIjjh1cLSPY+vvPpfgsC6VFTPlnQ4Dt9G7/V8e2E2LLr6jy6K Dvdp6Si8Al2I6p7lrOs/pjU/NtxAHjpD47mkk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=ZALCE4hXgZwjs9Gkkg9/x4oNrrx1gARGcIgeUQB/r8mmRpjRfZkEqZ/X9X+6JlKxFb Eg3F3sdSvButAOmPLdFCLRmx2EV5+hhSPCQk81wTjaqYeJqTIaOeq19ufcH6HE9aS2+D rRoZkYk6U9olcjRssyrCr+dZP1+B0KlOMOnrA= Received: by 10.216.6.200 with SMTP id 50mr1994196wen.117.1251374279940; Thu, 27 Aug 2009 04:57:59 -0700 (PDT) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 10sm908499eyd.10.2009.08.27.04.57.58 (version=SSLv3 cipher=RC4-MD5); Thu, 27 Aug 2009 04:57:59 -0700 (PDT) Message-ID: <4A967603.8070707@gmail.com> Date: Thu, 27 Aug 2009 14:03:15 +0200 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Thunderbird/3.0b3 MIME-Version: 1.0 To: Per Liden , tipc-discussion@lists.sourceforge.net, Andrew Morton , "David S. Miller" , netdev Subject: [PATCH] tipc: fix test of bearer_priority range in tipc_register_media() Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index a7a3677..327011f 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c @@ -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);