From patchwork Tue May 17 22:46:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 9115471 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 91E9B9F1C1 for ; Tue, 17 May 2016 22:47:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B663F2022D for ; Tue, 17 May 2016 22:47:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB971201C0 for ; Tue, 17 May 2016 22:47:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752008AbcEQWqp (ORCPT ); Tue, 17 May 2016 18:46:45 -0400 Received: from mout.gmx.net ([212.227.15.15]:51245 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751433AbcEQWqo (ORCPT ); Tue, 17 May 2016 18:46:44 -0400 Received: from LT001.lan ([62.143.92.134]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0M24ap-1bqUdJ2FAp-00u2EN; Wed, 18 May 2016 00:46:30 +0200 From: Heinrich Schuchardt To: Larry Finger , Chaoming Li , Kalle Valo Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Heinrich Schuchardt Subject: [PATCH 1/1] rtlwifi: rtl8723be: avoid undefined behavior Date: Wed, 18 May 2016 00:46:23 +0200 Message-Id: <1463525183-11483-1-git-send-email-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.1.4 X-Provags-ID: V03:K0:xFE6IXSL1h7kMn/HzQYvto6tLZ3KsvP/vvdmN64DZWkjeYvwXfA CYkF64N2WCZV/YmC2ttyNxo9phbDUMc8Y1OpbZSU9QDixkwoXydXt/gR4HpU0Fy3sCNKM4W kq0uQfj0cXSHyE/k2DeGtVF1lXn6ocj50r0gBw4kWdk44P1gdsIqSptUHzr3S/TOO/sCJFm G95ye3Xa3I+cKLF4llKmA== X-UI-Out-Filterresults: notjunk:1; V01:K0:3eMBubToGWk=:Wa1y/diJVjbVDv8pp2HMPK Q9BmoensLfgCyDwR9AWty23jwcfzDmdkB4f5F2NM4wMhRlNTM00zIJJdxBoc1P6lvO7BBd481 jczYPXhkDsJCYX3qrLUbvvAC/zIMDgcL7IZ8HCwgdZ+NBBS6iYcMheKDI20fz2riutCovKzR8 S3oNzP1jfcblG6/zFte1rST54oukHSJPm7Zw1L80q5he0KQ+iPZ49h7qkjGnzGjdz+IGmdHRG iWBfHmOhwyJIlrI+xlUw7d+RjsH6eKeYfvWv9bJjiOeG1KDCnImfyQFA5Cg7g52oKUmqoBris rqcYqLVCUG1NGaSGSAAdq7pGEBvLV2kyiztB3LStPit8c7u89SZV+6er3AyUPGNT+PSDOfsjz flKqeYiRosLjZ44xbX4HNGE1FPL9Bx+7xoSzYBjZS/FAWWY21WAPAHprK41fUK7Fi8lDuwLz+ GifiG58gQC9CE3Tt/TLXq/Dz/wpFZDTmUPASOdNtlzCkBkbxuht5+EuN1jrlmrr2Itz7wvWp5 IdOkYxf5Znj3f+vE/panI6Tao296q3HaBQLirLYk7cNrEqwwT6UXO9CAUSyNiFAZOaN010yJD cqN3GZ7WlYZ4iA4/4k8txD2KSY0JeY6wL3BoahEoqaMU7Aoz5NByaJreRK82NH/YYEIfBt/Zm pa63EHsFL1Wd4/USzm+z4mtlQKV7Ew95xCIcS1gMqovXDcP0h4FJOtBSMLB+0Dc/PwVfEAIbx pwb1CuXtDxTydbUpel++ab3lAvRc1PuzABu5NpizsRwL6TJA16WpYuDJ6wc= Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Do not return undefined value for transmission power if the rate is invalid. Signed-off-by: Heinrich Schuchardt Acked-by: Larry Finger --- drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c index 445f681..c5ca9df 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c @@ -1019,7 +1019,7 @@ static u8 _rtl8723be_get_txpower_index(struct ieee80211_hw *hw, u8 path, struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); u8 index = (channel - 1); - u8 txpower; + u8 txpower = 0; u8 power_diff_byrate = 0; if (channel > 14 || channel < 1) {