[PATCH wireless-next] wlcore: debugfs: add an error code check in beacon_filtering_write

From: Su Hui
Date: Sun Nov 12 2023 - 23:46:28 EST


wl1271_acx_beacon_filter_opt() return error code if failed, add a check
for this is better and safer.

Signed-off-by: Su Hui <suhui@xxxxxxxxxxxx>
---
drivers/net/wireless/ti/wlcore/debugfs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ti/wlcore/debugfs.c b/drivers/net/wireless/ti/wlcore/debugfs.c
index eb3d3f0e0b4d..d4071291a8cd 100644
--- a/drivers/net/wireless/ti/wlcore/debugfs.c
+++ b/drivers/net/wireless/ti/wlcore/debugfs.c
@@ -932,13 +932,15 @@ static ssize_t beacon_filtering_write(struct file *file,

wl12xx_for_each_wlvif(wl, wlvif) {
ret = wl1271_acx_beacon_filter_opt(wl, wlvif, !!value);
+ if (ret < 0)
+ break;
}

pm_runtime_mark_last_busy(wl->dev);
pm_runtime_put_autosuspend(wl->dev);
out:
mutex_unlock(&wl->mutex);
- return count;
+ return ret < 0 ? ret : count;
}

static const struct file_operations beacon_filtering_ops = {
--
2.30.2