Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp973107ybl; Thu, 22 Aug 2019 07:36:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8n444tzaaWLXEFVPXSnw3e8ANZ7Kn16r9221lWAvLa1OqxHV/GjrJQEP4NH1cl+hUL0K9 X-Received: by 2002:a17:902:6546:: with SMTP id d6mr21921441pln.338.1566484606167; Thu, 22 Aug 2019 07:36:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566484606; cv=none; d=google.com; s=arc-20160816; b=ruz9Ly+BSiA7ogIVafminhdCo27EpdJ7t2VAHjOQdRz/XRJM/cURaJP/gKPKgmZ5pF N2ujOZnXa93Z4rfyIZvQqLz50xJKWJRlx8f5VmJQ3WMN5sNtTdFCkb8ftty05w/v+pA0 nI7D7idwY6Mb+amJdJ2OmfxTDMifCwPlDIzJ70Kdg85zK15bxMWc0YxGU2UG9ncdJfP2 aX+kslnhMOLQQW7dFFQ9qUbBWhzNBMqfipN3UkTgc+CdpOaWOBLJ/hDEJoGcG8CZW/uC z7JypDMEbjWPjxoKvhnM7lRsWPxyVPLRad1/33qYWdE/PtIl6wsM6/HOMFFO5Nnkql8z fGiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=sopkrgqmYAaiYGmWMde0j9EBkYYjkypsh6I0mhK0T/4=; b=QBFr/U7IvuW9/g60Fqgbvti5oRIJppoLYCPN9mrHEQ8VcU3SWI7p7g5Nn8oPEqRNw7 NtDGu4HsjpLwpw70g28My+D+jhR9doOCbiuNq8UW/jLh0V4JdHcCd7y740b4tt739F0r iraVgzon4m7TkY6irKDip2YkYlaPc2C8mywUDIXkBoXLn8FjPKLAjt1ICb485DKwllZO kuZ9uxe+O7dL2CgWyCf5yGnGnCrkXZARTFstFjpoi/ZdOWY75cYUBSMwMLWe3Ctiv0NA /TaBCV+0lITIHfvZritGlJMwU8TgiKLkqRmCdASFYJrW+V6R8WTHHjX0rK9IxAQVAS1s 7DQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11si16768521pgu.16.2019.08.22.07.36.30; Thu, 22 Aug 2019 07:36:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732169AbfHVMUj (ORCPT + 99 others); Thu, 22 Aug 2019 08:20:39 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:34283 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728952AbfHVMUi (ORCPT ); Thu, 22 Aug 2019 08:20:38 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1i0m4x-00083J-2M; Thu, 22 Aug 2019 12:20:35 +0000 From: Colin King To: Felix Fietkau , Johannes Berg , "David S . Miller" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] mac80211: minstrel_ht: fix infinite loop because supported is not being shifted Date: Thu, 22 Aug 2019 13:20:34 +0100 Message-Id: <20190822122034.28664-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Colin Ian King Currently the for-loop will spin forever if variable supported is non-zero because supported is never changed. Fix this by adding in the missing right shift of supported. Addresses-Coverity: ("Infinite loop") Fixes: 48cb39522a9d ("mac80211: minstrel_ht: improve rate probing for devices with static fallback") Signed-off-by: Colin Ian King --- net/mac80211/rc80211_minstrel_ht.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index a01168514840..0ef2633349b5 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c @@ -634,7 +634,7 @@ minstrel_ht_rate_sample_switch(struct minstrel_priv *mp, u16 supported = mi->supported[g_idx]; supported >>= mi->max_tp_rate[0] % MCS_GROUP_RATES; - for (i = 0; supported; i++) { + for (i = 0; supported; supported >>= 1, i++) { if (!(supported & 1)) continue; -- 2.20.1