Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3252682pxj; Mon, 24 May 2021 02:17:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAoj366Npv2VI9ZjOLaRA/65E8rlsjwBgrl3dXRRws4dQKCpAEen8ThjChcAAQ20PRASdO X-Received: by 2002:a05:6402:190e:: with SMTP id e14mr24864058edz.146.1621847829317; Mon, 24 May 2021 02:17:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621847829; cv=none; d=google.com; s=arc-20160816; b=w3ghxJpWmt6rtz2FYyruBH/h4YpgQTX0BaGcSnZOon5kr1iQliBZlVRbm912WAv4M9 uB9xryLyVSWAqUXZCxnIi1EZccN/fvc8OzykAyfllHJUyFMiqYBbrRpxLoIE8Z9QiuOG NszwgdjuHfbsIzChZEVoLRuz5XrFE/IISZRQVaiiwWfMS3d/FaKoRiXIntQ1abgDkL3D vDGZL5JIzc3SVoMomVbzYrVuG5jBUyKaFVAkFT4p8+6JOwQMjj6O2X69aliOYeuzC4MD DEvMOGimix7cr0PiyroXN3QRXRVS0XXsFfQW/o5pZ8IVOG9z525EU+uFxvl041lj5XoK 3f8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6K069tPnUneKWRxunw2y88D5LoouSAc0ptqIttPGdXc=; b=jXLNVV0dPwEq//Ci+qL3bcCVoWNjUcpFtF0Nm/tXFpgUqr1ZRaDWJn10M050WAD4F7 6oK+cFwqrtjUJQ5R3QCGveKcTmNdmUmre9dd5RkQUK//i8EnJNG7rH0swcH4597JeigI BwD5TIUUgQqiXfoX7EFAfKG1qY6JhGCBq5xqj2vunykv2GLa6d9eUs7s2lasHpaxcCot SQZ8qR3q+nk7m0awttTRSlBgcQXirHl8ozo8SNgVY1QmccC2m++NG3Tzk6EGtiyiak7n gXN9O0jTTJejGva6hilzUoPixP66bFdAU7fdfo8tJR4qcZmzMC56VGpzWoWAqMNZW4QP W8lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jCz4XGle; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gt43si11361443ejc.459.2021.05.24.02.16.44; Mon, 24 May 2021 02:17:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jCz4XGle; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232495AbhEXJPN (ORCPT + 99 others); Mon, 24 May 2021 05:15:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:58170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232397AbhEXJPM (ORCPT ); Mon, 24 May 2021 05:15:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2EBD360FE7; Mon, 24 May 2021 09:13:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621847625; bh=gLEwh/xrg3/6bm6NA/iMItM0ghz5DNK9xGjeSvn1l0Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jCz4XGleLi33u/pN2fdy9FOgw4762PwQyV1uy5ts71SHEhBV1PUiHX+bpNL9zTC5K t1ToJwrok0w9FpaUUrMvvGDrylo8UFldtX/pCgyuGdyKPqKgggkhFEjwvJaNmwsnZH 3PuHcHE81+RKO4ni7JN8Kds2sn1+InbaXKvDtu1NobJbxrnl7kMC9Q76lsny6P9azX K14gCvIPArji73xKw6WwhaaInAMADD84Tr0OkMbr152Lj1UifsQIk0dw5y66juwHZB V/xJJ4F0LycpbFJyn1YblUy+pq4lRx4fEPgwCglX0vVtCo8MQ5mc3buar0mBN175JN X/6a2q/+v+zSg== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1ll6ec-00014d-R3; Mon, 24 May 2021 11:13:42 +0200 Date: Mon, 24 May 2021 11:13:42 +0200 From: Johan Hovold To: Hayes Wang Cc: "kuba@kernel.org" , "davem@davemloft.net" , "netdev@vger.kernel.org" , nic_swsd , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , "syzbot+95afd23673f5dd295c57@syzkaller.appspotmail.com" Subject: Re: [PATCH net v3] r8152: check the informaton of the device Message-ID: References: <1394712342-15778-363-Taiwan-albertk@realtek.com> <1394712342-15778-365-Taiwan-albertk@realtek.com> <1e7e1d4039724eb4bcdd5884a748d880@realtek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1e7e1d4039724eb4bcdd5884a748d880@realtek.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 24, 2021 at 08:54:50AM +0000, Hayes Wang wrote: > Johan Hovold > > Sent: Monday, May 24, 2021 4:01 PM > [...] > > > /* The vendor mode is not always config #1, so to find it out. */ > > > udev = interface_to_usbdev(intf); > > > c = udev->config; > > > num_configs = udev->descriptor.bNumConfigurations; > > > + if (num_configs < 2) > > > + return false; > > > + > > > > Nit: This check looks unnecessary also as the driver can handle a single > > configuration just fine, and by removing it you'd be logging "Unexpected > > Device\n" below also in the single config case. > > I just want to distinguish the devices. > It is acceptable if the device contains only one configuration. > A mistake occurs if the device has more configurations and > there is no expected one. > I would remove it if you think it is better. I'm fine with keeping the check too (e.g. as an optimisation of sort), it's just a bit inconsistent to not log an error in that one error path. Johan