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

Commit 323b3553 authored by Yue Ma's avatar Yue Ma
Browse files

cnss: Add NULL check in suspend/resume routine



penv should be checked before dereference otherwise it may lead to crash
in some cases.

Change-Id: I02016f4b911b35a8fba810117b7da461da8c4893
CRs-fixed: 665663
Signed-off-by: default avatarYue Ma <yuem@codeaurora.org>
parent de6c83ce
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -502,8 +502,12 @@ static void cnss_wlan_pci_remove(struct pci_dev *pdev)
static int cnss_wlan_pci_suspend(struct pci_dev *pdev, pm_message_t state)
{
	int ret = 0;
	struct cnss_wlan_driver *wdriver = penv->driver;
	struct cnss_wlan_driver *wdriver;

	if (!penv)
		goto out;

	wdriver = penv->driver;
	if (!wdriver)
		goto out;

@@ -517,8 +521,12 @@ out:
static int cnss_wlan_pci_resume(struct pci_dev *pdev)
{
	int ret = 0;
	struct cnss_wlan_driver *wdriver = penv->driver;
	struct cnss_wlan_driver *wdriver;

	if (!penv)
		goto out;

	wdriver = penv->driver;
	if (!wdriver)
		goto out;