Commit 35452e10 authored by Oscar Carter's avatar Oscar Carter Committed by Greg Kroah-Hartman
Browse files

staging: vt6656: Check the return values in vnt_set_bss_mode function



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: default avatarOscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200429152307.5871-2-oscar.carter@gmx.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2eeefd37
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -471,12 +471,15 @@ int vnt_radio_power_on(struct vnt_private *priv)

int vnt_set_bss_mode(struct vnt_private *priv)
{
	int ret = 0;
	int ret;

	if (priv->rf_type == RF_AIROHA7230 && priv->bb_type == BB_TYPE_11A)
		vnt_mac_set_bb_type(priv, BB_TYPE_11G);
		ret = vnt_mac_set_bb_type(priv, BB_TYPE_11G);
	else
		vnt_mac_set_bb_type(priv, priv->bb_type);
		ret = vnt_mac_set_bb_type(priv, priv->bb_type);

	if (ret)
		return ret;

	priv->packet_type = 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 = vnt_update_ifs(priv);
	if (ret)
		return ret;

	ret = vnt_set_rspinf(priv, (u8)priv->bb_type);
	if (ret)
		return ret;

	if (priv->bb_type == BB_TYPE_11A) {
		if (priv->rf_type == RF_AIROHA7230) {
@@ -521,6 +529,5 @@ int vnt_set_bss_mode(struct vnt_private *priv)
		priv->bb_vga[3] = 0x0;
	}

	vnt_set_vga_gain_offset(priv, priv->bb_vga[0]);
	return 0;
	return vnt_set_vga_gain_offset(priv, priv->bb_vga[0]);
}