Skip to content

Commit

Permalink
staging: r8192e_pci: Change memcpy to memcmp
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Larry Finger authored and Greg Kroah-Hartman committed Apr 20, 2012
1 parent ef2353d commit ea9f10f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/staging/rtl8192e/rtllib_softmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand Down

0 comments on commit ea9f10f

Please sign in to comment.