Commit a831b913 authored by Samuel Ortiz's avatar Samuel Ortiz Committed by John W. Linville

NFC: Do not return EBUSY when stopping a poll that's already stopped

We check for the polling flag before checking if the netlink PID caller
match.
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 1550bf2d
...@@ -634,6 +634,15 @@ static int nfc_genl_stop_poll(struct sk_buff *skb, struct genl_info *info) ...@@ -634,6 +634,15 @@ static int nfc_genl_stop_poll(struct sk_buff *skb, struct genl_info *info)
if (!dev) if (!dev)
return -ENODEV; return -ENODEV;
device_lock(&dev->dev);
if (!dev->polling) {
device_unlock(&dev->dev);
return -EINVAL;
}
device_unlock(&dev->dev);
mutex_lock(&dev->genl_data.genl_data_mutex); mutex_lock(&dev->genl_data.genl_data_mutex);
if (dev->genl_data.poll_req_pid != info->snd_pid) { if (dev->genl_data.poll_req_pid != info->snd_pid) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment