diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-07-12 17:44:50 (GMT) |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-07-12 17:44:50 (GMT) |
commit | 38a00840638b4932152bca48098dbfa069d942a2 (patch) | |
tree | dd12897854f6df8aac237d5fd46551c74be8153a /net/nfc/netlink.c | |
parent | 391e5c22f5f4e55817f8ba18a08ea717ed2d4a1f (diff) | |
parent | 2f8684ce7a47c91da7e0ccba2686277c103d02b6 (diff) | |
download | linux-38a00840638b4932152bca48098dbfa069d942a2.tar.xz |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Diffstat (limited to 'net/nfc/netlink.c')
-rw-r--r-- | net/nfc/netlink.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c index f4f07f9..4c51714 100644 --- a/net/nfc/netlink.c +++ b/net/nfc/netlink.c @@ -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) { |