summary refs log tree commit diff
path: root/net/nfc/core.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2013-04-10 12:25:30 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2013-04-11 16:29:10 +0200
commit7757dc8a3e7658abb6e5fc7d825a38b27961d0c8 (patch)
treebaf60c1117faa0c747d0330d9b9c15e031f18628 /net/nfc/core.c
parent7c5a54fb869d980c2a3c0972fe1e22816dd5b7b2 (diff)
downloadlinux-7757dc8a3e7658abb6e5fc7d825a38b27961d0c8.tar.gz
NFC: Prevent polling when device is down
Some devices turn radio on whenever they're asked to start a poll.
To prevent that from happening, we just don't call into the driver
start_poll hook when the NFC device is down.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/core.c')
-rw-r--r--net/nfc/core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/nfc/core.c b/net/nfc/core.c
index 6ceee8e181ca..c571ca9a960c 100644
--- a/net/nfc/core.c
+++ b/net/nfc/core.c
@@ -143,6 +143,11 @@ int nfc_start_poll(struct nfc_dev *dev, u32 im_protocols, u32 tm_protocols)
 		goto error;
 	}
 
+	if (!dev->dev_up) {
+		rc = -ENODEV;
+		goto error;
+	}
+
 	if (dev->polling) {
 		rc = -EBUSY;
 		goto error;