lkml.org 
[lkml]   [2019]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net] staging: rtl8188eu: use is_zero_ether_addr() instead of memcmp()
On Sat, Mar 09, 2019 at 11:26:00AM +0800, Mao Wenan wrote:
> Using is_zero_ether_addr() instead of directly use
> memcmp() to determine if the ethernet address is all
> zeros.
>
> Signed-off-by: Mao Wenan <maowenan@huawei.com>
> ---
> drivers/staging/rtl8188eu/core/rtw_mlme.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c
> index 714f7a70ed64..beae367df93b 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c
> @@ -180,9 +180,8 @@ struct wlan_network *rtw_find_network(struct __queue *scanned_queue, u8 *addr)
> {
> struct list_head *phead, *plist;
> struct wlan_network *pnetwork = NULL;
> - u8 zero_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
>
> - if (!memcmp(zero_addr, addr, ETH_ALEN)) {
> + if (is_zero_ether_addr(addr)) {

As Joe said, you have to prove that this is properly aligned before you
can call this function. Please do so.

thanks,

greg k-h

\
 
 \ /
  Last update: 2019-03-17 12:27    [W:0.097 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site