Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4900526iob; Mon, 9 May 2022 04:26:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxt3bOuptnXuhhPeIrnUTwLoQUlnHQbvQ32uZjnq4QaiKv70t9Z8lEEfq7fUrfYgd9Tlw6H X-Received: by 2002:a17:90a:14a6:b0:1dc:f64f:ff2c with SMTP id k35-20020a17090a14a600b001dcf64fff2cmr10561749pja.161.1652095578206; Mon, 09 May 2022 04:26:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652095578; cv=none; d=google.com; s=arc-20160816; b=0WWPdRRjiu3IQnSAcUx3Sn4ljWGG164m+/cdUAOE1SkYqioslZqc43qzDo+zthO4xR x0/XcC2yt08PBJ1YjnbAfp3eyCOeYtG+qWn/MXeqxkqdmfHVEYBg1HS1VcbNdATJfZJi n1VCBWggOlBlAKy9PhU5/hsfgwu91zlvEH2VyT98b49Bs38ilwcTkn5+mYVWLlEtQTR+ +57vTIGVxL9dczUFQmcLmiQm9tUNiHkYxaULiFgK2XSrDzan2Dnx2I7PSosR0niT/L5K mISZsMAd/ki5Im19P1Oovntbip3eJA5nCzoGWMUDKVJK7LNQDnnPrWfVUQ0T1T6Wr3hC yceQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=/nebMqVfT+54zsFtvKohJbYf+QR1kkUWhZbfriasr58=; b=WJLyRxMuDaJ8d0HRLmARPF8DnBGSqdmyGzc8FgIOJcirzHHvf+9fct6nEEPU7ikEm6 Zndk1LeP+kQz9pACZ88hTsj7uEIFhkJXPbvjbRH+RkbS0gqbTV1YV+GqUMAR25fzWWmJ 9ambOGqAPGYByyBqTsPN5Ra0mbKgudBvRdAcjjPWLpdFBW6F4ekngSCkZWCvwD0Uz4iY d6KQib+ewxYmiSkl/OaP97Vtc0GOV2SRNjyEKh9diosMv59qJtDsrOBSz2e/oSbzGXqH xVIa+R2QYO0AltCaaAlDlWh3P2wiDlaAKvdLUbPXdQQBa645raGveBaOvRKpm/5xZPop Q1og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OroYPBv6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n1-20020a170902e54100b0015d9e670bfesi13612027plf.554.2022.05.09.04.26.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 04:26:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OroYPBv6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C26792AD77F; Mon, 9 May 2022 03:34:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1389639AbiEFHpI (ORCPT + 99 others); Fri, 6 May 2022 03:45:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343782AbiEFHpF (ORCPT ); Fri, 6 May 2022 03:45:05 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE68D5DA4D for ; Fri, 6 May 2022 00:41:22 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id y32so11196730lfa.6 for ; Fri, 06 May 2022 00:41:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=/nebMqVfT+54zsFtvKohJbYf+QR1kkUWhZbfriasr58=; b=OroYPBv6tDt222Zrkqx2eB3zMfsQ3LD8gGdxVqOuIp7Klct/n0Q9UDLe9rDcUaTRvA y5srW3JLT1UVXGlrrDt9uEWSl6x0AhPjgXzCARhQ8iRM6u85SC7td3+aiPd2cIdh3+OD MHGkA37r+Wo5NxNMmXo8uTYnMICTylbSvEFBQdbHiiO1ctrp5ygMnfpp6Ym92F9YFVbh LSksaGVz8sQDxh3M3qR8h6qLpe/9tm1w+NktYZXbHEQrUUwcaeXlffaPQKoIwsEEFQDa LK461sWoOujgfAvtowg/IXrpRJQtXjYJg94/aKWHp/ywIrpSQ3D3yv/GdTnhA8MCBQ0b LjEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=/nebMqVfT+54zsFtvKohJbYf+QR1kkUWhZbfriasr58=; b=HG4y/4kO871SbCq/8VxWOcORqC4gpjkRNelZcHOa/lPBu3SQDl0rUkzImrdtmWhUWf 5HrO3cwAOKDAImjlCxVOR8+MapMMsUgLZ+PJ8oNUKv4+8Xs6vGBjxQTHWnRkvPrqKLXd w6RLWVQbE+EnZhEMoJEWTk9b9kwI7A47FPK2zQIVz0lHD6NB+wYwZCJr0gEBflrMK1dk f8ZARKAFkT/NG1WWWoKEEAUA4ajDx/wp54kOhEFC/+hAOVsKvlibrg292XlDBZXRbk1T r8p+nhvfqI2PlTS6dYUiL+sRUdzPj8pbtTzNMokgm1+n2sWFbR33n2raPTbmB4RLStda vDxA== X-Gm-Message-State: AOAM530pgTNAEwN28Y/atY81+KF3NoidFEz8ImJEIMDRJ8VZhwT2ZdGR BL7CMM6au8eTu0/nqcZNN5MLknMbkAk= X-Received: by 2002:ac2:4e14:0:b0:473:bdfa:e48e with SMTP id e20-20020ac24e14000000b00473bdfae48emr1567859lfr.230.1651822880808; Fri, 06 May 2022 00:41:20 -0700 (PDT) Received: from [192.168.1.11] ([217.117.246.114]) by smtp.gmail.com with ESMTPSA id p21-20020a05651212d500b0047255d211dbsm567937lfg.266.2022.05.06.00.41.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 May 2022 00:41:20 -0700 (PDT) Message-ID: <46b89616-5ec7-fb04-f561-2647efd968c4@gmail.com> Date: Fri, 6 May 2022 10:41:19 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v2 2/2] staging: rtl8712: fix uninit-value in r871xu_drv_init() Content-Language: en-US To: Wang Cheng , dan.carpenter@oracle.com Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org References: <14c3886173dfa4597f0704547c414cfdbcd11d16.1651760402.git.wanngchenng@gmail.com> From: Pavel Skripkin In-Reply-To: <14c3886173dfa4597f0704547c414cfdbcd11d16.1651760402.git.wanngchenng@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Wang, On 5/6/22 06:16, Wang Cheng wrote: [snip] > > Reported-and-tested-by: syzbot+6f5ecd144854c0d8580b@syzkaller.appspotmail.com > Signed-off-by: Wang Cheng > --- > drivers/staging/rtl8712/usb_intf.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c > index ee4c61f85a07..50dcd3ecb685 100644 > --- a/drivers/staging/rtl8712/usb_intf.c > +++ b/drivers/staging/rtl8712/usb_intf.c > @@ -538,13 +538,13 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf, > } else { > AutoloadFail = false; > } > - if (((mac[0] == 0xff) && (mac[1] == 0xff) && > + if ((!AutoloadFail) || > + ((mac[0] == 0xff) && (mac[1] == 0xff) && > (mac[2] == 0xff) && (mac[3] == 0xff) && > (mac[4] == 0xff) && (mac[5] == 0xff)) || > ((mac[0] == 0x00) && (mac[1] == 0x00) && > (mac[2] == 0x00) && (mac[3] == 0x00) && > - (mac[4] == 0x00) && (mac[5] == 0x00)) || > - (!AutoloadFail)) { > + (mac[4] == 0x00) && (mac[5] == 0x00))) { That looks ugly. I mean mac checks. Can we, please, use sane kernel API like is_valid_ether_addr()? > mac[0] = 0x00; > mac[1] = 0xe0; > mac[2] = 0x4c; With regards, Pavel Skripkin