Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1108499pxb; Sun, 22 Aug 2021 06:13:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhGvV8p/m2Nl+SDaz8bA5QQWuNz1Pt7GSEdK4iwZ/kEMPU7Ps89/iQTJlW4Tn556r7PS3e X-Received: by 2002:a05:6e02:dcc:: with SMTP id l12mr19852930ilj.20.1629638025107; Sun, 22 Aug 2021 06:13:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629638025; cv=none; d=google.com; s=arc-20160816; b=DQrNPaGTwes5I9z7Fpyembn/NOkIHCuiDCcD2iRIIBnI7pOJpGj3z+xIB3n9CBSnp1 f7lbyxlK+KSZF+7+proXEFjVJdv/nlFcYUOypWoUs+5hp75RhQD0xpOfOQ7dNw6zRYe+ dy5tBmSTIuIWmaICvJ+gMqag5w+5YCVH20hBM4/WIdco5sxVFCKZ7HJE6ppv6g28mEGQ AXQmPSlnws7+uycDf7naOvxe294avtmHXrov31Agd6vhUZVpOnR8Qby73/s0Ybo5CSGG VQrsgMw5FxZjrkWL8p0tABNYjOnKtLeSkhamY1aRQlqW4pCO0E1BJQXqf323SJVKT0CN CKkw== 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=t6i8snfSnIBnSlS17U9kkkiOhEP8NHZ7zI2p/e5kM9g=; b=Z5DR1xekOqfiswWff7EOLGis0w8SjiLgo/FzIKHNDSLAkp+OgyQnU24GHOCA5RJq9/ wr2sR7ivm1Pz0z0ucFynDLd1L1Ny9leanmS3J1eTBOLhvJ8i5EM0WBqaOy55hftAJDxh Gh6SVjIZaYMq0PQ5KlryHHNqogYsKgCpeb8Lbjg7Y8MsyC448uNrsKld8BEDD6WrOPSq 6c5OQEMLJLw9eVP/J6RZQCLkGxYJFr3YXYMxZATFpFDDHp19QMozVlpe51OGT32eNhhr j8lVIuGji6jHpeBuuWGa8PW41j6JEEfiZLgvMbX/MyNPFpZqrcjuYhkxMq5+GrC07wtv vWBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=B3IUzMTX; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q14si11919952ilm.44.2021.08.22.06.13.33; Sun, 22 Aug 2021 06:13:45 -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=@linuxfoundation.org header.s=korg header.b=B3IUzMTX; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231877AbhHVNHh (ORCPT + 99 others); Sun, 22 Aug 2021 09:07:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:44786 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230495AbhHVNHg (ORCPT ); Sun, 22 Aug 2021 09:07:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F316B61206; Sun, 22 Aug 2021 13:06:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1629637615; bh=EQOmStsJmOqdUqnPphlHpXfj8gNo53ILHo1sVqpPmz0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=B3IUzMTXP27vOPWqw/5sm00/EGje48cZMDLO92t/3N8bB3+oDIiqM1U+lYI1coRe0 GODJJLVrPhCeV4tIPTrgRTjI0GFXwqf1HKPmcUx4Gyxd8XXBJiZ+gCHWRXRFsC0OAb Lvq8fh+/iSWXZoDJXZk1qRaWezjy7qrudU5qfysI= Date: Sun, 22 Aug 2021 15:06:52 +0200 From: Greg KH To: Pavel Skripkin Cc: "Fabio M. De Francesco" , Larry.Finger@lwfinger.net, phil@philpotter.co.uk, straube.linux@gmail.com, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: Re: [PATCH RFC 0/3] staging: r8188eu: avoid uninit value bugs Message-ID: References: <10584649.zhyk0TxWeL@localhost.localdomain> <2327383.5TodInGmHT@localhost.localdomain> <435eea22-da31-1ebc-840c-ee9e42b27265@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 22, 2021 at 03:50:35PM +0300, Pavel Skripkin wrote: > On 8/22/21 3:39 PM, Greg KH wrote: > > > > > > Yes, but _rtw_read*() == 0 indicates 2 states: > > > > > > 1. Error on transfer side > > > 2. Actual register value is 0 > > > > That's not a good design, it should be fixed. Note there is the new > > usb_control_msg_recv() function which should probably be used instead > > here, to prevent this problem from happening. > > > > Thank you, Greg, for confirmation. That's was the point why I started to > write this series :) > > I think, usb_control_msg_recv() won't help us with this problem, since all > rtw_read*() functions return an unsigned value now. In future, when driver > code will be fixed (ex: a lot of void function, which can fail and leave > passed pointer uninitialized) we can move to new usb API and then move > driver out of staging :) That function _should_ be used at the lower levels of this call chain. If you want to go from the top -> down or bottom -> up of fixing this is your choice, but as others have pointed out, this patch series as-is still needs some work. thanks, greg k-h