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

Commit 803394d0 authored by Colin Ian King's avatar Colin Ian King Committed by Greg Kroah-Hartman
Browse files

staging: ks7010: do not dereference priv if priv is null



priv is being dereferenced before a check for it being null
is made, so there is a possibililty a null pointer deference
can occur. Instead, only dereference priv if it is non-null.

Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6bef3f01
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1134,7 +1134,6 @@ static void ks7010_sdio_remove(struct sdio_func *func)
	int ret;
	struct ks_sdio_card *card;
	struct ks_wlan_private *priv;
	struct net_device *netdev;
	DPRINTK(1, "ks7010_sdio_remove()\n");

	card = sdio_get_drvdata(func);
@@ -1144,8 +1143,9 @@ static void ks7010_sdio_remove(struct sdio_func *func)

	DPRINTK(1, "priv = card->priv\n");
	priv = card->priv;
	netdev = priv->net_dev;
	if (priv) {
		struct net_device *netdev = priv->net_dev;

		ks_wlan_net_stop(netdev);
		DPRINTK(1, "ks_wlan_net_stop\n");