瀏覽代碼

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>
Samuel Ortiz 12 年之前
父節點
當前提交
7757dc8a3e
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      net/nfc/core.c

+ 5 - 0
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;