Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9081528pxu; Mon, 28 Dec 2020 06:11:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxNoOLyw+xWnq/2WUfZPXyKs0wgBSylM2yLv1pIUiyOqgyOjj4k4UND5WcnVxyiQoWv0IHp X-Received: by 2002:a05:6402:1d13:: with SMTP id dg19mr42246524edb.111.1609164697322; Mon, 28 Dec 2020 06:11:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609164697; cv=none; d=google.com; s=arc-20160816; b=MEWPM71Tps1hXtHtSMFqhJZlHJR+N9+SGR17nvGz6IOfcxfxyj4LCIl7p/ObXX4qif mgIhm+YyVkmliCFdWgMhzAD2XrIniLr6V77CEMRxjsELLeDCU/UgRCdgFCzNM5xMRiJb 6YlDi00mgv/WHFbO2P0p1P3rHvu18v96aA35Fx2SEe073Y7yfUhi+7wiLNffmfn4IjT/ 4vN3PD+fa74SxiiI/86fMFwBBdC1x6zAnL51BRwgL6fFKJoNeLalhpaXTFiMN2pUw2K+ 7/TORkmcBnE1Jbf2jrKrp7XpPRlUf+L8AZjQqfq4NCKvALrZM6hZzC2RzsMnx/NP1rSm d13g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vMzghCYgmDaOdlqfzN2UMimWC9h5UTgxfnoasRtZOjg=; b=PRqRCNvkZZ/A7+NjeC2wcGGJlExmZW2MuDe3p4Su28vA3ZXjHCLh0LF8cgBetjD306 29iHpH7hJneqoyqKGVX9ugmprfpa25xMltpkW4waHf2h0dc+MmImEzr1Eizhy4l+c5Qw 0Pwfu9gLcYAvO3TEURDB2grmjVR4l95+uzw07+LNmZkIHcUfNJ1j/7O/Ex+b4V8Mw/gn T3yKoRtMkZ+LmZXvfgfQ0zgQ0BgZ3hKdACFTSbW7vnbnKZZNP2RLha2Vrz8WtvE+9DwL HhyI0f3D3JcDb0e26jyoq2LTmYEhIJ2eRlB8jd3+bfzhAK8ug/Y5nCVQvvWqPdJ/SBho AyjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UhNJHOg8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s20si16047257eji.61.2020.12.28.06.11.13; Mon, 28 Dec 2020 06:11:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UhNJHOg8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438694AbgL1OIr (ORCPT + 99 others); Mon, 28 Dec 2020 09:08:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:42300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391717AbgL1OI2 (ORCPT ); Mon, 28 Dec 2020 09:08:28 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A2E81206E5; Mon, 28 Dec 2020 14:08:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164493; bh=R2+XnK1mBVZDZaoo85ii98mkoFyxt2WLuIpLD2Hc6/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UhNJHOg88dQLOZOG0YlzLEPKyT8onIq6WgbOR8yqG1rux4BLH0qgViU/AL4XwYvjo /THGx4ytsU84ztREB+nv7NmCsE+fyEgsaO+pKXXFTib1oG0mJWT6nl1WN1QmQl7uiP FZ0xaXrfYSTSoyf97lu/xEcSMO6yXwjfJOkbBLRo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zhang Changzhong , Kalle Valo , Sasha Levin Subject: [PATCH 5.10 199/717] rsi: fix error return code in rsi_reset_card() Date: Mon, 28 Dec 2020 13:43:17 +0100 Message-Id: <20201228125030.508897943@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhang Changzhong [ Upstream commit fb21d14694bd46a538258d86498736490b3ba855 ] Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 17ff2c794f39 ("rsi: reset device changes for 9116") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1605582454-39649-1-git-send-email-zhangchangzhong@huawei.com Signed-off-by: Sasha Levin --- drivers/net/wireless/rsi/rsi_91x_usb.c | 30 +++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c index a62d41c0ccbc0..00b5589847985 100644 --- a/drivers/net/wireless/rsi/rsi_91x_usb.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c @@ -741,24 +741,24 @@ static int rsi_reset_card(struct rsi_hw *adapter) if (ret < 0) goto fail; } else { - if ((rsi_usb_master_reg_write(adapter, - NWP_WWD_INTERRUPT_TIMER, - NWP_WWD_INT_TIMER_CLKS, - RSI_9116_REG_SIZE)) < 0) { + ret = rsi_usb_master_reg_write(adapter, + NWP_WWD_INTERRUPT_TIMER, + NWP_WWD_INT_TIMER_CLKS, + RSI_9116_REG_SIZE); + if (ret < 0) goto fail; - } - if ((rsi_usb_master_reg_write(adapter, - NWP_WWD_SYSTEM_RESET_TIMER, - NWP_WWD_SYS_RESET_TIMER_CLKS, - RSI_9116_REG_SIZE)) < 0) { + ret = rsi_usb_master_reg_write(adapter, + NWP_WWD_SYSTEM_RESET_TIMER, + NWP_WWD_SYS_RESET_TIMER_CLKS, + RSI_9116_REG_SIZE); + if (ret < 0) goto fail; - } - if ((rsi_usb_master_reg_write(adapter, - NWP_WWD_MODE_AND_RSTART, - NWP_WWD_TIMER_DISABLE, - RSI_9116_REG_SIZE)) < 0) { + ret = rsi_usb_master_reg_write(adapter, + NWP_WWD_MODE_AND_RSTART, + NWP_WWD_TIMER_DISABLE, + RSI_9116_REG_SIZE); + if (ret < 0) goto fail; - } } rsi_dbg(INFO_ZONE, "Reset card done\n"); -- 2.27.0