All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: r8192e_pci: Change memcpy to memcmp
@ 2012-04-20 17:21 Larry Finger
  0 siblings, 0 replies; only message in thread
From: Larry Finger @ 2012-04-20 17:21 UTC (permalink / raw)
  To: gregkh; +Cc: Larry Finger, linux-kernel, devel

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>
---

Greg,

This routine has never been entered in all my testing of this driver,
thus this patch has no particular priority.

Thanks,

Larry
---

 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 c5a15db..703fa84 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) == NULL) {
 		rtllib->state = RTLLIB_NOLINK;
 
 		for (i = 0; i < 6; i++)
-- 
1.7.10.130.g36e6c


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-04-20 17:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-20 17:21 [PATCH] staging: r8192e_pci: Change memcpy to memcmp Larry Finger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.