[PATCH] ath10k: fix debug cal data file
Valo, Kalle
kvalo at qca.qualcomm.com
Wed Sep 28 06:26:36 PDT 2016
Nikolay Martynov <mar.kolya at gmail.com> writes:
> It got broken by 0b8e3c4ca29fe2c0efd3d41a76e34a657b9f17a4
>
> Signed-off-by: Nikolay Martynov <mar.kolya at gmail.com>
Good catch, I'll queue this to 4.9.
There was one checkpatch warning I fixed:
drivers/net/wireless/ath/ath10k/debug.c:1477: Prefer vmalloc(sizeof(*data)...) over vmalloc(sizeof(struct ath10k_debug_cal_data)...)
The commit log is quite short so added more information about the bug.
The full patch is in the pending branch.
Author: Nikolay Martynov <mar.kolya at gmail.com>
Date: Wed Sep 28 15:11:52 2016 +0300
ath10k: fix debug cal data file
Commit 0b8e3c4ca29f ("ath10k: move cal data len to hw_params") broke retrieving
the calibration data from cal_data debugfs file. The length of file was always
zero. The reason is:
static ssize_t ath10k_debug_cal_data_read(struct file *file,
char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath10k *ar = file->private_data;
void *buf = file->private_data;
This is obviously bogus, private_data cannot contain both struct ath10k and the
buffer. Fix it by introducing a new temporary structure for storing both the
length of the buffer and the actual buffer, then struct ath10k is not needed
anymore.
Fixes: 0b8e3c4ca29f ("ath10k: move cal data len to hw_params")
Cc: stable at vger.kernel.org # 4.7+
Signed-off-by: Nikolay Martynov <mar.kolya at gmail.com>
[kvalo at qca.qualcomm.com: improve commit log, fix a checkpatch warning]
Signed-off-by: Kalle Valo <kvalo at qca.qualcomm.com>
--
Kalle Valo
More information about the ath10k
mailing list