mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
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>
This commit is contained in:
parent
7b9bc799a4
commit
69218a4800
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user