Received: by 2002:ac0:950e:0:0:0:0:0 with SMTP id f14csp1111014imc; Sun, 17 Mar 2019 04:27:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhulquWYCJS0gVtz6uoErozTTKQBJd0eaW3Yz6B1sltTFJy6Msi6LVIumMGB+7OT6GK36w X-Received: by 2002:a63:dc4a:: with SMTP id f10mr11751475pgj.231.1552822062277; Sun, 17 Mar 2019 04:27:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552822062; cv=none; d=google.com; s=arc-20160816; b=E3GJGkBP+E0Js36QiphSzm6T9Mce23mW3wUM5VlgbSJaeL4NLbCL/PgSLwEd5tCumh QOUbl6OQYO+iiufySnmt44GokkeuekQCsiD9NGP3TZOXBTxVeMWVQn27OrQa+wwZ0F0+ 8VeLwVhcO7DlM6UUtRjJeAR74nBDSAkRFZAiCx46rBYA5XCpLMFhlRFfVMYf3HMwAabk BROv+o3d5ngi5QZ6fb292fA9M8k6UhlJgWwMrIerMiGbhBJW+ZLA/mI7eVNk7LFjjDER MJLoD/WtAm9C1x/5C4AJhRPlZIMzZ+KfyVBxnWfEFHLdip32oRy/EynKwIgSL0c0KlY5 kxcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jxWckW6gs9UnjgfPbVYi7RbGnUjhpV7RHcw7vGhr1gs=; b=xwgMeqOx41LCjIUN+GTO8PFf6BWe4elGkidk/HWcVjcUEA7fVc9nKZSktwk74dvlqd bktxlI2tV5EjW5f0cMGuT6LezylQPhY1ndg4szzSoNGpj2PvffsK5eZ6qagdq8lL5xbh E1WT5P94unikvh9FJMeWPWeBraoRV8DZ9VmvTZS5MJBqsLcVa0VPRWJxji5uSHVpdJQG Z6tfDzBbKp/xKxBUcc4xKCl1YYo2/QmHkTO0ARwifzU3LkRYlF0Jmajr02z2vpZi0im9 5zi+EzYqyldIFS4ujVPBY1+yBEqC1SFQ/XMJpuYj3rdP0PeQPXKDKgQsj7sSvYEiFVOX +igQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YpepTi+I; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k33si5453878pld.388.2019.03.17.04.27.27; Sun, 17 Mar 2019 04:27:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YpepTi+I; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726875AbfCQL0u (ORCPT + 99 others); Sun, 17 Mar 2019 07:26:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:60116 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726479AbfCQL0u (ORCPT ); Sun, 17 Mar 2019 07:26:50 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3F7DF21738; Sun, 17 Mar 2019 11:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552822009; bh=HSrT56cU8BsYxZKYsTXMNClA9He2xkCvH556nQsu/S8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YpepTi+I53fm/7xFQ2p3bGo/38MuHPuWPktZUoHVREEPguF9pfIOSeB5ME5wXBocf uV6q6SKzUz2cT91PILt761IKnw0c4SF8pEEEQegnHsTOT+eS0P0M9O4f85jvfryj85 2I6q1KHrMjIob9iFnnkrdXktZM2txhYBPRArA8jY= Date: Sun, 17 Mar 2019 12:26:47 +0100 From: Greg KH To: Mao Wenan Cc: Larry.Finger@lwfinger.net, straube.linux@gmail.com, jananis37@gmail.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, davem@davemloft.net Subject: Re: [PATCH net] staging: rtl8188eu: use is_zero_ether_addr() instead of memcmp() Message-ID: <20190317112647.GG4614@kroah.com> References: <20190309032600.98732-1-maowenan@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190309032600.98732-1-maowenan@huawei.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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