From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7720C43387 for ; Fri, 11 Jan 2019 14:16:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 797B621783 for ; Fri, 11 Jan 2019 14:16:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547216162; bh=zZvLHw4jBNPaqYJlfkn6142XFss+SrZsJjT82EMuyVM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Re3LK6GonxNdJh1bJ20e/Zi446ep4K1Hf+qDNmuicuWyi0cbIoYxVK8rqXb11fN8f X19A7bhGORK/ANgjGg+34nc4EQIqBgLdKWoW1Ynq6FzQ2JiX3W33C6tlvvwfXQS7Co qJlESHcqisx3AxJbPpMbx4uV29QXbyxWD1WADVkM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387528AbfAKOQB (ORCPT ); Fri, 11 Jan 2019 09:16:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:60300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387520AbfAKOQB (ORCPT ); Fri, 11 Jan 2019 09:16:01 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 12F9C20874; Fri, 11 Jan 2019 14:15:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547216160; bh=zZvLHw4jBNPaqYJlfkn6142XFss+SrZsJjT82EMuyVM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=THd6AhmwT2r0rVMLIkgyApUEfdyLViIEJ0yf8GUC4mxqVRFeNaFd2xhX7dTxk70VD BizDgM+EsVGhNT69q3OR8VkQ9O5jxckVcDkBQm7ZaLr3CMDPopArdJM4qbCx0/J3r6 LG7g0rj9DMXKwu5Z0r4jHD5ulp9ZJpOIFPdcFHjw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Priit Laes , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Larry Finger , Kalle Valo Subject: [PATCH 3.18 43/47] b43: Fix error in cordic routine Date: Fri, 11 Jan 2019 15:08:28 +0100 Message-Id: <20190111131001.720792092@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111130956.170952125@linuxfoundation.org> References: <20190111130956.170952125@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Larry Finger commit 8ea3819c0bbef57a51d8abe579e211033e861677 upstream. The cordic routine for calculating sines and cosines that was added in commit 6f98e62a9f1b ("b43: update cordic code to match current specs") contains an error whereby a quantity declared u32 can in fact go negative. This problem was detected by Priit Laes who is switching b43 to use the routine in the library functions of the kernel. Fixes: 986504540306 ("b43: make cordic common (LP-PHY and N-PHY need it)") Reported-by: Priit Laes Cc: Rafał Miłecki Cc: Stable # 2.6.34 Signed-off-by: Larry Finger Signed-off-by: Priit Laes Signed-off-by: Kalle Valo Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/b43/phy_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/wireless/b43/phy_common.c +++ b/drivers/net/wireless/b43/phy_common.c @@ -609,7 +609,7 @@ struct b43_c32 b43_cordic(int theta) u8 i; s32 tmp; s8 signx = 1; - u32 angle = 0; + s32 angle = 0; struct b43_c32 ret = { .i = 39797, .q = 0, }; while (theta > (180 << 16))