Kalle Valo <kv...@qca.qualcomm.com> writes:

> +     ret = copy_from_user(buf, user_buf, count);
> +     if (ret)
> +             goto err_free_copy;
> +
> +     ret = ath10k_hif_diag_write(ar, *ppos, buf, count);
> +     if (ret) {
> +             ath10k_warn(ar, "failed to write address 0x%08x via diagnose 
> window from debugfs: %d\n",
> +                         (u32)(*ppos), ret);
> +             goto err_free_copy;
> +     }
> +
> +     *ppos += count;
> +     ret = count;
> +
> +err_free_copy:
> +     vfree(buf);
> +     return ret;

This introduces a new smatch warning:

drivers/net/wireless/ath/ath10k/debug.c:1100 ath10k_mem_value_write()
warn: maybe return -EFAULT instead of the bytes remaining?

I think it should be like this:

ret = copy_from_user(buf, user_buf, count);
if (ret) {
        ret = -EFAULT;
        goto err_free_copy;
}

Comments?

-- 
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to