Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1122119pxb; Sun, 22 Aug 2021 06:35:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAbieAYLktLZG7oMNvTshEPZyStD9GdgLJItcub7z3AefIkc2WaZgbqJ/zM4p2TmDprT3K X-Received: by 2002:a17:906:eda8:: with SMTP id sa8mr20081154ejb.234.1629639332224; Sun, 22 Aug 2021 06:35:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629639332; cv=none; d=google.com; s=arc-20160816; b=MT6g8BM/FGmIuWCJe5ogzTgUaXfG9L8USLYoRk4Xvr9JnqoJCNadfVrfRtJ7R9N+um 0H0NlkxWLqFGzdF940zT2TlieiWU2awxrhXaGwkO7jaC3Rwk354lRPrPWAfXeT4ERb0b 2ewMQ06sfNYh+t6oSqL9JSjBxmKNyYBsRyLYyA0uNFijyX63MmCgxHRo7Fu3QhTHPD1N WxC7nCGzp16QAptFxmHZKDo13b5QWKC9BKxjjTU1xwMa/J6YI3XtfjAYpTJjZ/BmOreG Y9PwLZS3/VKheF+7EvyXr+7UMIg5CXw3eH5Lv2opc7vJ/KrVpnDTwTvjR+JL59BQyXQP jCbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=JsMbuvBD0CchbCI3lgM2niPcU+m6IwFJ9H/VVzweq2Y=; b=nfjgrbcXBZdZzL7+fQp5k61QcAsU3HQkvakMy2Ck0xwN2WY7XKMgY9dZj3Y615wpJK kdZZl/naTpdw0lt9FshM7SR1nq+pIfJEPqyL9dPoFxHoiilmjBjNOGIgTRzjjBemWreq lo0/5qm/wtT1HN5n3M3jRmlUjsU5mczPNlEUukFzqinqJt3ht3jVelWa8t3CSiuDLHKH ZLd86vcjepIzqjljO7Zt9TF5sUgfyEvzhhgqH0ydbVKx9MQbW6c2VhifmrwnT+ga45dR mYUI5HE1+aJU+Ar9cMTlFEy5OOA5FaQQ2SJf6nQM7fvyYXAXrQSmvWnJAivIDnCFNLRd ourg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qqC9mwg+; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id yd20si11132821ejb.468.2021.08.22.06.35.08; Sun, 22 Aug 2021 06:35:32 -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=@gmail.com header.s=20161025 header.b=qqC9mwg+; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232494AbhHVNcR (ORCPT + 99 others); Sun, 22 Aug 2021 09:32:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230495AbhHVNcQ (ORCPT ); Sun, 22 Aug 2021 09:32:16 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53F26C061575 for ; Sun, 22 Aug 2021 06:31:35 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id s3so26174042ljp.11 for ; Sun, 22 Aug 2021 06:31:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=JsMbuvBD0CchbCI3lgM2niPcU+m6IwFJ9H/VVzweq2Y=; b=qqC9mwg+6tew+qt42fhQ14SEJoobc+VZ/le58VUqaa7Qw1gMu+oeD54wymply9L2rm H25a8c1/F54keEf2e15xL42wXTinMoH/teuVA/0MUblGhJjuQIqsG3HHp4jYdJk7IONJ 7/c9yNiy4fFH1X2gjMIGSrYBZMHyiwZbru1r1vyWkDb7C9DjG5Vo3hayUkD4vWuxaCSU WsGWTcr+815ZIc4mB4R+TjchnrBuUvI/plsPw5a6rEp7oEDpLSsbZUr6hTq4eCww3tT5 WGe9on24hMKiGK2fpx6MOx6JODNvDfU622IYJ8uFq8SmB94VToYXxmAgDZV4b5An0jb2 YVeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=JsMbuvBD0CchbCI3lgM2niPcU+m6IwFJ9H/VVzweq2Y=; b=NAd6viKbZeaZkxldNGfCd9608CpUVyxRxHJP4w+39Raujzu+CZ4wx3b1jlA9LxP3N3 y3HRHjpuRS0Fm1Kd9snPd4mBefSIoOgTwns3ie/gFLn2obKXb2W5jDqKyb+KeWhBIvoS /ohQ8wP7JfeZoRhWvmSZRO5yC60zH269IIz9Vqpb2v8etsw3CTUTVeDAyMwU5LNys1xr TTN+QgFzCvZvivQ+JQI7GjOxnUTpNf9Ia5u2V88ZJL5j1O3r9Sd9U047oqeFmol8fAeH Jh7O/0Tut4nvNHKA+/BFEYV/TPofLDFJ7WQeqVBpRXEhDoMP38+1S6OXfsLqzTSRFvZ8 7Zxw== X-Gm-Message-State: AOAM533cJAvBRriCea5unl5hbZ+PcT6Ogs/9AmX5okdV5DA3201AGhrp phOJqQciztj2vwNiF+x06icUV1KIDHqc9lHS X-Received: by 2002:a2e:a261:: with SMTP id k1mr22481980ljm.509.1629639093250; Sun, 22 Aug 2021 06:31:33 -0700 (PDT) Received: from [192.168.1.11] ([46.235.66.127]) by smtp.gmail.com with ESMTPSA id bn3sm1180121ljb.18.2021.08.22.06.31.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Aug 2021 06:31:32 -0700 (PDT) Subject: Re: [PATCH RFC 0/3] staging: r8188eu: avoid uninit value bugs To: "Fabio M. De Francesco" , Greg KH Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, straube.linux@gmail.com, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser References: <435eea22-da31-1ebc-840c-ee9e42b27265@gmail.com> <2244219.zNr1yEsLHP@localhost.localdomain> From: Pavel Skripkin Message-ID: <6182ed46-d79d-7f66-c7c0-096486410b4d@gmail.com> Date: Sun, 22 Aug 2021 16:31:31 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <2244219.zNr1yEsLHP@localhost.localdomain> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/22/21 4:21 PM, Fabio M. De Francesco wrote: > On Sunday, August 22, 2021 2:39:34 PM CEST Greg KH wrote: >> On Sun, Aug 22, 2021 at 03:10:56PM +0300, Pavel Skripkin wrote: >> > On 8/22/21 1:59 PM, Fabio M. De Francesco wrote: >> > > On Sunday, August 22, 2021 12:09:29 PM CEST Pavel Skripkin wrote: > [...] >> > > So, it's up to the callers to test if (!_rtw_read*()) and then act >> > > accordingly. If they get 0 they should know how to handle the errors. >> > >> > 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. > > I think that no functions should return 0 for signaling FAILURE. If I'm not > wrong, the kernel quite always prefers to return 0 on SUCCESS and <0 on > FAILURE. Why don't you just fix this? > That's what I've done in v2. All rtw_read* family will have following prototype in v2: int __must_check _rtw_read8(struct adapter *adapter, u32 addr, u8 *data); Was it your idea, or you were talking about different approach? With regards, Pavel Skripkin