From: Frank Leipold Date: Mon, 20 Oct 2008 13:37:53 +0000 (+0100) Subject: uwb: wrong sizeof argument in mac address compare X-Git-Tag: upstream/snapshot3+hdmi~21778^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c15895ef30c2c03e99802951787183039a349d32;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git uwb: wrong sizeof argument in mac address compare In the __uwb_beca_find_bymac function the sizeof returns the length of a pointer and not the data it is referring to. Hence only the first 4 bytes were compared, not the entire 6 bytes MAC address. Now the sizeof takes struct uwb_mac_addr as argument. Signed-off-by: Frank Leipold Signed-off-by: David Vrabel --- diff --git a/drivers/uwb/beacon.c b/drivers/uwb/beacon.c index c7f3c97..46b18ee 100644 --- a/drivers/uwb/beacon.c +++ b/drivers/uwb/beacon.c @@ -207,7 +207,7 @@ struct uwb_beca_e *__uwb_beca_find_bymac(const struct uwb_mac_addr *mac_addr) struct uwb_beca_e *bce, *next; list_for_each_entry_safe(bce, next, &uwb_beca.list, node) { if (!memcmp(bce->mac_addr, mac_addr->data, - sizeof(bce->mac_addr))) + sizeof(struct uwb_mac_addr))) goto out; } bce = NULL;