18 Aug 2012 10:47
[patch] staging: ozwpan: fix memcmp() test in oz_set_active_pd()
Dan Carpenter <dan.carpenter <at> oracle.com>
2012-08-18 08:47:59 GMT
2012-08-18 08:47:59 GMT
"addr" is a pointer so it's either 4 or 8 bytes, but actually we want
to compare 6 bytes (ETH_ALEN).
Signed-off-by: Dan Carpenter <dan.carpenter <at> oracle.com>
diff --git a/drivers/staging/ozwpan/ozcdev.c b/drivers/staging/ozwpan/ozcdev.c
index d983219..63c1b67 100644
--- a/drivers/staging/ozwpan/ozcdev.c
+++ b/drivers/staging/ozwpan/ozcdev.c
<at> <at> -213,7 +213,7 <at> <at> 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 (!memcmp(addr, "\0\0\0\0\0\0", ETH_ALEN)) {
spin_lock_bh(&g_cdev.lock);
pd = g_cdev.active_pd;
g_cdev.active_pd = 0;
RSS Feed