Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c830abe authored by Maya Erez's avatar Maya Erez Committed by Kalle Valo
Browse files

wil6210: fix chan check in wil_p2p_listen



In wil_p2p_listen chan is checked to protect against NULL
pointer access only before setting channel = chan->hw_value.
Add a global parameter check to cover all accesses to chan.

Signed-off-by: default avatarMaya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent deb85bb1
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -114,7 +114,9 @@ int wil_p2p_listen(struct wil6210_priv *wil, unsigned int duration,
	u8 channel = P2P_DMG_SOCIAL_CHANNEL;
	int rc;

	if (chan)
	if (!chan)
		return -EINVAL;

	channel = chan->hw_value;

	wil_dbg_misc(wil, "%s: duration %d\n", __func__, duration);