From patchwork Thu Apr 26 14:42:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10366141 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1902760225 for ; Thu, 26 Apr 2018 14:42:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 084ED2850D for ; Thu, 26 Apr 2018 14:42:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0CE92847A; Thu, 26 Apr 2018 14:42:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F3982847A for ; Thu, 26 Apr 2018 14:42:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756565AbeDZOm5 (ORCPT ); Thu, 26 Apr 2018 10:42:57 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:33876 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754727AbeDZOmy (ORCPT ); Thu, 26 Apr 2018 10:42:54 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w3QEet3o015149; Thu, 26 Apr 2018 14:42:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=Lf40ymoFEJiJ6J7TkkOzVDRNK9LuEvQzr4DCdSxliBE=; b=qHzkBTtxq1EnCppePO+H2lFLeSxtGH/gAzZ76Hy9FDvo0AYgSI+AqaWIUxCjiqAArB4j FQHLEblwt7PynCELNb/INNVrRQht/mapF5Sd1s1Thr960gA/d4mgzUymYjEOtS3+tIYy +NtRQuQDpL5wf3/dBY62RJH7g3gnOyG6P6pUM/09O47kCgEHi2ibgtAghDyxjN2ADV4h UxIFsPbsugCARfNBPq6/UBGL+M0rSLQjYSfW9syVv0YLjvz5TYA8b3CrohtsE8Scsb7M 2XmfyQAAh0Bst+YkXHmy6Aac2yqtNlhMtS9uiPMpjzv0nqcyNFgXkaFW2p9DXKSM/vjt BQ== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2hfvrc3kmc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Apr 2018 14:42:45 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w3QEghAZ008685 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Apr 2018 14:42:44 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w3QEghDF029165; Thu, 26 Apr 2018 14:42:43 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 26 Apr 2018 07:42:43 -0700 Date: Thu, 26 Apr 2018 17:42:35 +0300 From: Dan Carpenter To: Kalle Valo , Amitkumar Karwar Cc: Prameela Rani Garnepudi , Siva Rebbagondla , Karun Eagalapati , linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] rsi: Uninitialized return value in rsi_reset_card() Message-ID: <20180426144235.GA25897@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8874 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804260140 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If rsi_usb_master_reg_write() fails then "ret" hasn't been initialized. Fixes: 16d3bb7b2f37 ("rsi: disable fw watchdog timer during reset") Signed-off-by: Dan Carpenter diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c index b065438f51b2..6ce6b754df12 100644 --- a/drivers/net/wireless/rsi/rsi_91x_usb.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c @@ -687,9 +687,10 @@ static int rsi_reset_card(struct rsi_hw *adapter) */ msleep(100); - if (rsi_usb_master_reg_write(adapter, SWBL_REGOUT, - RSI_FW_WDT_DISABLE_REQ, - RSI_COMMON_REG_SIZE) < 0) { + ret = rsi_usb_master_reg_write(adapter, SWBL_REGOUT, + RSI_FW_WDT_DISABLE_REQ, + RSI_COMMON_REG_SIZE); + if (ret < 0) { rsi_dbg(ERR_ZONE, "Disabling firmware watchdog timer failed\n"); goto fail; }