]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: ks7010: fix off by one error
authorTobin C. Harding <me@tobin.cc>
Wed, 15 Mar 2017 01:01:07 +0000 (12:01 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Mar 2017 02:41:36 +0000 (11:41 +0900)
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 <dan.carpenter@oracle.com>
Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks_wlan_net.c

index 0852a1d975950a364e7ae5859b26bff955243f58..651d4799733baee0e40e66e65eb0e948467b779b 100644 (file)
@@ -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",