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