From ea9f10f2fd207bb70a730ee3b356f75bc00ff41d Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Fri, 20 Apr 2012 14:45:37 -0500 Subject: [PATCH] staging: r8192e_pci: Change memcpy to memcmp 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 Signed-off-by: Larry Finger Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtllib_softmac.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index c5a15dba1bf5..ec98ed715beb 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -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++) -- 2.39.5