projects
/
GitHub
/
exynos8895
/
android_kernel_samsung_universal8895.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1550bf2
)
NFC: Do not return EBUSY when stopping a poll that's already stopped
author
Samuel Ortiz
<sameo@linux.intel.com>
Thu, 28 Jun 2012 14:41:57 +0000
(16:41 +0200)
committer
John W. Linville
<linville@tuxdriver.com>
Mon, 9 Jul 2012 20:42:21 +0000
(16:42 -0400)
We check for the polling flag before checking if the netlink PID caller
match.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
net/nfc/netlink.c
patch
|
blob
|
blame
|
history
diff --git
a/net/nfc/netlink.c
b/net/nfc/netlink.c
index 03c31db38f1284dbceed6cb57a97ab8ec0bd13ab..99bc6f7faa7b858e28254b3690ca46b1592d24fb 100644
(file)
--- 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) {