summaryrefslogtreecommitdiffstats
path: root/net/nfc/rawsock.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/nfc/rawsock.c')
-rw-r--r--net/nfc/rawsock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/nfc/rawsock.c b/net/nfc/rawsock.c
index b2825aa85f64..ec1134c9e07f 100644
--- a/net/nfc/rawsock.c
+++ b/net/nfc/rawsock.c
@@ -92,8 +92,8 @@ static int rawsock_connect(struct socket *sock, struct sockaddr *_addr,
goto error;
}
- if (addr->target_idx > dev->target_idx - 1 ||
- addr->target_idx < dev->target_idx - dev->n_targets) {
+ if (addr->target_idx > dev->target_next_idx - 1 ||
+ addr->target_idx < dev->target_next_idx - dev->n_targets) {
rc = -EINVAL;
goto error;
}