aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/wil6210
diff options
context:
space:
mode:
authorLior David <qca_liord@qca.qualcomm.com>2016-03-21 22:01:11 +0200
committerKalle Valo <kvalo@qca.qualcomm.com>2016-04-04 17:07:28 +0300
commit69218a48005d0c93b8e9ec483f42ead481a43034 (patch)
tree43e0829abad37c34d968529a679b58485b84ed35 /drivers/net/wireless/ath/wil6210
parentath5k: Change led pin configuration for compaq c700 laptop (diff)
downloadlinux-dev-69218a48005d0c93b8e9ec483f42ead481a43034.tar.xz
linux-dev-69218a48005d0c93b8e9ec483f42ead481a43034.zip
wil6210: allow empty WMI commands in debugfs wmi_send
There are many valid WMI commands with only header without any additional payload. Such WMI commands could not be sent using the debugfs wmi_send facility. Fix the code to allow sending of such commands. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com> Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210')
-rw-r--r--drivers/net/wireless/ath/wil6210/debugfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
index a4d3f70c3d29..b338a09175ad 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -832,7 +832,7 @@ static ssize_t wil_write_file_wmi(struct file *file, const char __user *buf,
u16 cmdid;
int rc, rc1;
- if (cmdlen <= 0)
+ if (cmdlen < 0)
return -EINVAL;
wmi = kmalloc(len, GFP_KERNEL);
@@ -845,7 +845,7 @@ static ssize_t wil_write_file_wmi(struct file *file, const char __user *buf,
return rc;
}
- cmd = &wmi[1];
+ cmd = (cmdlen > 0) ? &wmi[1] : NULL;
cmdid = le16_to_cpu(wmi->command_id);
rc1 = wmi_send(wil, cmdid, cmd, cmdlen);