Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[deliverable/linux.git] / net / nfc / netlink.c
index f4f07f9b61c0e092ba7f81154bae71feacbbec59..4c51714ee74177509d6d7831c064e89280424ded 100644 (file)
@@ -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) {
This page took 0.025904 seconds and 5 git commands to generate.