diff mbox series

ti: wlcore: fix error return code of wl1271_suspend()

Message ID 20210306143600.19676-1-baijiaju1990@gmail.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series ti: wlcore: fix error return code of wl1271_suspend() | expand

Commit Message

Jia-Ju Bai March 6, 2021, 2:36 p.m. UTC
When wl is NULL, no error return code of wl1271_suspend() is assigned.
To fix this bug, ret is assigned with -EINVAL in this case.

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
 drivers/net/wireless/ti/wlcore/sdio.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Kalle Valo April 18, 2021, 5:55 a.m. UTC | #1
Jia-Ju Bai <baijiaju1990@gmail.com> wrote:

> When wl is NULL, no error return code of wl1271_suspend() is assigned.
> To fix this bug, ret is assigned with -EINVAL in this case.
> 
> Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>

Someone needs to review this.

Patch set to Changes Requested.
diff mbox series

Patch

diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index 9fd8cf2d270c..a040d595a43a 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -390,6 +390,7 @@  static int wl1271_suspend(struct device *dev)
 
 	if (!wl) {
 		dev_err(dev, "no wilink module was probed\n");
+		ret = -EINVAL;
 		goto out;
 	}