Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp733508ybz; Wed, 29 Apr 2020 08:26:32 -0700 (PDT) X-Google-Smtp-Source: APiQypJyfj0zYmSNJGvE5Mzbw2IUHh4WvSWFIGbntbUIXIIrYWh/HBNV48fQQ4lu4hbHz8zdEeqN X-Received: by 2002:a50:c3c2:: with SMTP id i2mr3062504edf.227.1588173991970; Wed, 29 Apr 2020 08:26:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588173991; cv=none; d=google.com; s=arc-20160816; b=S04qAw9JyRyHUKposubwPOlogmI7gZ/u43LfBw6SJdyHiApxFm8l4C6TKyWQ9u5AiE O04EI22ZHSq+KQyvpZuEPNqfGYxdyxBG3TrSqBfJjFpvJ9d4NbUdqbduIDL5yLQZ/8B0 +zSd8f+tWntkoUY+n3g/O5pfGB06KvfFqr/SG9tN7VyLEmgGWx3jpO6dICnaE+d2booH i1R7J1a8z9LGMF/CN0d+RBA+ZNKB5Yel4Cz5k3H5AxthHEHFv9/IF1lrHgd0O3l5MSY4 pkxadS7BsABwvKWrxCyjS9mSD1yQ82NzOh+50AIxBbzu95aVhq4snB5FU46v3QcqPk6B Vvkw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vpSx1OsrOUGL9o792+EIMABN/MXnyRyns4HTpENlTTA=; b=noDePDlYx4CjMF7qbs93jS73i8dIR096I0Nwv3nDIKnyaZiF6t/1cWFyXfkM6c/N/8 5wWLEM5UL2JNjIKhGNaVPwO0QS7RHtUfmGH/JCb8OtL++DdD2OyN4NF/rB2AiaIeNfQ1 DKPkrQMHngyLsX8ZVsYM2kG4aqXGEmPfgATeBe5wl3UvF/J38BTWc4Q7b8iV14x3wChB 5Cmv3uNDOCyd4Ek0vD/S9USNqSdDaIRRAAzhTLm7wMwfXGnxu7SisUfFbfNDF9Rm7wL7 P/4YTCnM7LUuiwmBjPKg0sQ7QEXNcEDDGS2thslVKAmUP+Vx20hNxaXLKtw1gvxwy7f7 KILg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=e3nWgTOf; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u10si3588150edl.591.2020.04.29.08.26.01; Wed, 29 Apr 2020 08:26:31 -0700 (PDT) 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=@gmx.net header.s=badeba3b8450 header.b=e3nWgTOf; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727079AbgD2PXh (ORCPT + 99 others); Wed, 29 Apr 2020 11:23:37 -0400 Received: from mout.gmx.net ([212.227.17.21]:41919 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726539AbgD2PXg (ORCPT ); Wed, 29 Apr 2020 11:23:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1588173810; bh=9xJxvPZShBiX5YUVDWZ45XfKd4uqcu8Vsjy9FyH64YU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=e3nWgTOf+HhmtONAWtIUrqfhWKz/6Qxpto7McGsZR+Sa80eKd7KY1piCDVpOyPVoq 966KX17Zno94XdDrNQZKyifIF13PIXMNg6ARHcnovBY/Kjita9KpPVlIrDAFoVJbss +Z8otm/vsByZrH9jCwsCq6jDUtjCs2CFxxLXy+VY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([83.52.229.196]) by mail.gmx.com (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MDywu-1jM9Zt32we-00A1Zo; Wed, 29 Apr 2020 17:23:29 +0200 From: Oscar Carter To: Forest Bond , Greg Kroah-Hartman Cc: Oscar Carter , Malcolm Priestley , Quentin Deslandes , "John B. Wyatt IV" , Colin Ian King , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] staging: vt6656: Check the return values in vnt_set_bss_mode function Date: Wed, 29 Apr 2020 17:23:06 +0200 Message-Id: <20200429152307.5871-2-oscar.carter@gmx.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200429152307.5871-1-oscar.carter@gmx.com> References: <20200429152307.5871-1-oscar.carter@gmx.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:HdUsT6dvbq2UpXZVFJxcEXX2tRtTQpAhdm9OGUOACPwLWho2M+D WO5GbI+MNc5aJNQ1rPpwGjmgpIRgGvjl2uKIlJcGVsLq46viPX1HsOCv4JX/kPN41a9HLYm 6CFaUExtFoTZnnPREq47DS2OtCJ3xpE2C4fGsrhtF5M/t2kxF1SSzBnJnI4pdXaQFLDy8t+ MD104Mvmy7DFLNZ2ySuAw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:LtSUTWmsIO8=:vKkpsHPS3gezVEYqCRLRec TYWiqx3NiC2UIYvF140Fet2LuOJ+wkexGpC2GDdotVLKYv3P3J4JuPj8w3kTmL4IuDzAGWrFJ 8LxSDMjHcCOvI2kuszr01CCjIpcT0+yDhKGgE4j0UhywJ0cJKMdfftZ3k66MvYeoHyq2zE8ru xP/Xrz/U8RqGqP/RlU2I+bAcju4pii34Xh/kfXI49S5xHCXrUXiVw7ptzHg1Q1tgM+nq1FaNR B22Us+MxhmgzgxfKngoexww5coG/7rnMZ5ML+Pr0i2p/GXBGCWpkDtBhPOJGwDCUlZBwStqFS EpblQ3Fn5C67HStmQySBcLs78VbYKm2gKxBI5okiERQXtdQ9vFL0SsL9DRP6Ce9YR8Lfx0r8F yzYJaNNowtM6n0U9FKq3JI1NkRgZS7SmYD8glMjVkd5tWNjA8amTMpUqRl0+ohgrqxJMTJ4IL MulzUF/7fkFP+gPgy0cngSkyt5RJbgfLSjaoJgQDo3/iwA9gBfj0tOhk73JzwwpIEiCTg02Bb xKEiRccaS5dtl8+X35LZ15jkJcx2PY2t8yfLvPyifqGZLADqbCOE6HLNVT8emSqTi8a8drx6N CHKKtLbFa4qjLyEooibTLhzzNhANL/aqnCj5AwTMbtoiqowYT/syH4OWjz7MZUktyJdtTBPxF 7gPqC+epyktPSOvtm8yA38RQtGAx1T2m4ich34fc0NaqpXbReyIPDdfC4y05Uq8ZMvv9MoKyQ 9bEFdZ6YBSY/z3eu0sxsCkPwIzI6JyhEP+Qnf0cTTnzT6f304kJtEgZkWrZdpj7o5qr1bHRvB ruIjo23FeyQkpNM9DAP+MpbTeF1ka3FdB/V49n6mnWFK9r3woTFMF59euup5gCtBd8iWexv+u MGpEYAp75nAFqggbl+pbvusvQPjhROOhJaUk0QF/7vwNN+gHpUA6y3L14FEXXlUhmZ3P2xIQw YI8eJ6RWCneN5o+phiN9Fa5MH+ci1t3qC+kQ9H15zMWYNL5zfygbbxP44PGHxqm0nJs46ExWW XN1fale0HVfZmncpmXGPRQ3oByf81dSCubi+opx3AaftG7lu4HbxVb4jWGkosnu1+vmjDhPup KlC/v5PFeE/YWxfRhNiGPHQF9OQMHAWeWkzz0MLYKv/6vvMjMP7MJSL9EFh3G0VFcNWjZl28x aMytOfYJJ2R6a+a6DgOm6jbFNnNTGnlBuvLAv0rd6WSwBLCV8RNztzA+EHyUbKYEV4YqV6Qn8 Uc+2aBV663RAmQOt4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Check the return value of all the functions that return zero if successful or a negative error code on failure inside the function vnt_set_bss_mode. Also, remove the unnecessary variable initialization as this variable is set a few lines later. Signed-off-by: Oscar Carter =2D-- drivers/staging/vt6656/card.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c index 872717f9df49..0854b70cb89f 100644 =2D-- a/drivers/staging/vt6656/card.c +++ b/drivers/staging/vt6656/card.c @@ -471,12 +471,15 @@ int vnt_radio_power_on(struct vnt_private *priv) int vnt_set_bss_mode(struct vnt_private *priv) { - int ret =3D 0; + int ret; if (priv->rf_type =3D=3D RF_AIROHA7230 && priv->bb_type =3D=3D BB_TYPE_1= 1A) - vnt_mac_set_bb_type(priv, BB_TYPE_11G); + ret =3D vnt_mac_set_bb_type(priv, BB_TYPE_11G); else - vnt_mac_set_bb_type(priv, priv->bb_type); + ret =3D vnt_mac_set_bb_type(priv, priv->bb_type); + + if (ret) + return ret; priv->packet_type =3D vnt_get_pkt_type(priv); @@ -492,8 +495,13 @@ int vnt_set_bss_mode(struct vnt_private *priv) if (ret) return ret; - vnt_update_ifs(priv); - vnt_set_rspinf(priv, (u8)priv->bb_type); + ret =3D vnt_update_ifs(priv); + if (ret) + return ret; + + ret =3D vnt_set_rspinf(priv, (u8)priv->bb_type); + if (ret) + return ret; if (priv->bb_type =3D=3D BB_TYPE_11A) { if (priv->rf_type =3D=3D RF_AIROHA7230) { @@ -521,6 +529,5 @@ int vnt_set_bss_mode(struct vnt_private *priv) priv->bb_vga[3] =3D 0x0; } - vnt_set_vga_gain_offset(priv, priv->bb_vga[0]); - return 0; + return vnt_set_vga_gain_offset(priv, priv->bb_vga[0]); } =2D- 2.20.1