summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorLior David <qca_liord@qca.qualcomm.com>2016-05-15 14:38:26 +0300
committerKyle Yan <kyan@codeaurora.org>2016-05-31 15:28:08 -0700
commit857cb953f008186eefe7aa66a6ed3cd5722422f4 (patch)
treea9bb9c29790b28485ecce20fb06c30bad87d12c2 /drivers/net
parent6cdf8d4db4365f973c9dd9467723708e49b1e403 (diff)
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. Change-Id: I581e099db5d2ee81be4345101aa54352b1d9564f 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> Git-commit: 69218a48005d0c93b8e9ec483f42ead481a43034 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git CRs-Fixed: 1015627 Signed-off-by: Maya Erez <merez@codeaurora.org>
Diffstat (limited to 'drivers/net')
-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 96169cb0dfd0..f3de1759a86a 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -838,7 +838,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);
@@ -851,7 +851,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);