summaryrefslogtreecommitdiff
path: root/drivers/staging/ozwpan
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2012-08-19 19:36:37 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-04 12:48:00 -0700
commit07732be2efa7d4ade66d224ea84d2c30740d0b77 (patch)
tree4ad5a8451c1fca878b0684ef081f2d3bf8fdc1db /drivers/staging/ozwpan
parent01f8a27e3c9109c0187f473e593fa7b45cdb65e8 (diff)
staging: ozwpan: fix memcmp() test in oz_set_active_pd()
"addr" is a pointer so it's either 4 or 8 bytes, but actually we want to compare 6 bytes (ETH_ALEN). As network stack already provides helper function is_zero_ether_addr() we use that instead of memcmp Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Acked-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Rupesh Gujare <rgujare@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ozwpan')
-rw-r--r--drivers/staging/ozwpan/ozcdev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/ozwpan/ozcdev.c b/drivers/staging/ozwpan/ozcdev.c
index d98321945802..758ce0a8d82e 100644
--- a/drivers/staging/ozwpan/ozcdev.c
+++ b/drivers/staging/ozwpan/ozcdev.c
@@ -8,6 +8,7 @@
#include <linux/cdev.h>
#include <linux/uaccess.h>
#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
#include <linux/poll.h>
#include <linux/sched.h>
#include "ozconfig.h"
@@ -213,7 +214,7 @@ static int oz_set_active_pd(u8 *addr)
if (old_pd)
oz_pd_put(old_pd);
} else {
- if (!memcmp(addr, "\0\0\0\0\0\0", sizeof(addr))) {
+ if (is_zero_ether_addr(addr)) {
spin_lock_bh(&g_cdev.lock);
pd = g_cdev.active_pd;
g_cdev.active_pd = 0;