From 7bb6313d011f16405b338a228f540d3ab5aee58a Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 15 Mar 2017 12:01:07 +1100 Subject: [PATCH] staging: ks7010: fix off by one error Bug introduced in commit 7676b72 by Tobin C. Harding. Remove equals sign from comparison, fixing off by one error. Fixes: 7676b72428e8 ("staging: ks7010: move comparison to right hand side") Reported-by: Dan Carpenter Signed-off-by: Tobin C. Harding Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ks7010/ks_wlan_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c index 0852a1d97595..651d4799733b 100644 --- a/drivers/staging/ks7010/ks_wlan_net.c +++ b/drivers/staging/ks7010/ks_wlan_net.c @@ -2044,7 +2044,7 @@ static int ks_wlan_set_pmksa(struct net_device *dev, if (ptr != &priv->pmklist.head) /* not find address. */ break; /* case */ - if (priv->pmklist.size <= PMK_LIST_MAX) { /* new cache data */ + if (priv->pmklist.size < PMK_LIST_MAX) { /* new cache data */ for (i = 0; i < PMK_LIST_MAX; i++) { pmk = &priv->pmklist.pmk[i]; if (!memcmp("\x00\x00\x00\x00\x00\x00",