Skip to content

Commit

Permalink
NFC: Do not return EBUSY when stopping a poll that's already stopped
Browse files Browse the repository at this point in the history
We check for the polling flag before checking if the netlink PID caller
match.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Samuel Ortiz authored and John W. Linville committed Jul 9, 2012
1 parent 1550bf2 commit a831b91
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions net/nfc/netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,15 @@ static int nfc_genl_stop_poll(struct sk_buff *skb, struct genl_info *info)
if (!dev)
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);

if (dev->genl_data.poll_req_pid != info->snd_pid) {
Expand Down

0 comments on commit a831b91

Please sign in to comment.