staging: r8192e_pci: Change memcpy to memcmp
authorLarry Finger <Larry.Finger@lwfinger.net>
Fri, 20 Apr 2012 19:45:37 +0000 (14:45 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Apr 2012 22:12:12 +0000 (15:12 -0700)
Routine rtllib_MlmeDisassociateRequest() has a comparison of memcpy()
with NULL, which makes no sense. Analysis of the code suggests that
memcmp() was intended.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtllib_softmac.c

index c5a15dba1bf5b265e611bf0e04f7386d9b35abc8..ec98ed715beb01c62c0d9b2fadd8e64a150eeccc 100644 (file)
@@ -3679,8 +3679,7 @@ void rtllib_MlmeDisassociateRequest(struct rtllib_device *rtllib, u8 *asSta,
 
        RemovePeerTS(rtllib, asSta);
 
-
-       if (memcpy(rtllib->current_network.bssid, asSta, 6) == NULL) {
+       if (memcmp(rtllib->current_network.bssid, asSta, 6) == 0) {
                rtllib->state = RTLLIB_NOLINK;
 
                for (i = 0; i < 6; i++)