public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH wireless-next] wlcore: debugfs: add an error code check in beacon_filtering_write
@ 2023-11-13  4:41 Su Hui
  2023-11-13  6:16 ` Kalle Valo
  0 siblings, 1 reply; 5+ messages in thread
From: Su Hui @ 2023-11-13  4:41 UTC (permalink / raw)
  To: kvalo; +Cc: Su Hui, linux-wireless, linux-kernel, kernel-janitors

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@nfschina.com>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-11-15  3:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-13  4:41 [PATCH wireless-next] wlcore: debugfs: add an error code check in beacon_filtering_write Su Hui
2023-11-13  6:16 ` Kalle Valo
2023-11-13  6:53   ` Su Hui
2023-11-13 12:07     ` Kalle Valo
2023-11-15  3:40       ` Su Hui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox