Commit 39876a01 authored by Michael Straube's avatar Michael Straube Committed by Greg Kroah-Hartman
Browse files

staging: r8188eu: remove null pointer checks before kfree



kfree(NULL) is safe, so remove unnecessary null pointer checks before
calls to kfree. Reported by checkpatch.

Signed-off-by: default avatarMichael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210818085809.31451-1-straube.linux@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7972067a
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1314,7 +1314,6 @@ static void update_bcn_wps_ie(struct adapter *padapter)
		pnetwork->IELength = wps_offset + (wps_ielen + 2) + remainder_ielen;
	}

	if (pbackup_remainder_ie)
	kfree(pbackup_remainder_ie);
}

+3 −10
Original line number Diff line number Diff line
@@ -89,12 +89,8 @@ void rtw_free_evt_priv(struct evt_priv *pevtpriv)

void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv)
{

	if (pcmdpriv) {
		if (pcmdpriv->cmd_allocated_buf)
		kfree(pcmdpriv->cmd_allocated_buf);

		if (pcmdpriv->rsp_allocated_buf)
		kfree(pcmdpriv->rsp_allocated_buf);
	}
}
@@ -818,11 +814,8 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)

	psecnetwork = (struct wlan_bssid_ex *)&psecuritypriv->sec_bss;
	if (!psecnetwork) {
		if (pcmd)
		kfree(pcmd);

		res = _FAIL;

		goto exit;
	}