Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4652920iob; Sun, 8 May 2022 20:42:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6m3N1XDaIFadD/5aT8jXT+rpalCrR7Fm3w3cK8SmDDDjbX4ePfvO/z8ORyCR0Z4UeKSAR X-Received: by 2002:a17:90b:2241:b0:1dc:d4d3:3047 with SMTP id hk1-20020a17090b224100b001dcd4d33047mr16441575pjb.128.1652067767650; Sun, 08 May 2022 20:42:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652067767; cv=none; d=google.com; s=arc-20160816; b=QwhD9dExeJhkE9SfOxZwDLHe4MrGmAJYrllLJTCTNZSsl3b9BAbuvsecK39a0EZbqX Z0ve5Aqjruegun5BvAhpcDAPF1L/95khtBXdba79QOdau9yXYuuoYV7/IiexgJF81Jl0 AaIwYnSWThlt7PIyXfA0Fte7fD1w3c3X7N1gRXlhMLonMoKe3dfEsC/GmVsD7PdHPbMp 9+yZWyQe/TNI0FI7X2/l3rmQDceoE4b/8XeIJ8RhPLK1pHU3PfCo55pLBMbjQcpKgZGU kq2UcdDFrQor9HuouZ8jCf/NeMLGmoq1iebmrmiS6LbmDk+lnf9jeT+XU1bhsNXcU0Gw KqBg== 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=jwgJ3xGvdcAfXK7drFXwrp4QaKarW2SpAQVEU9d/grI=; b=WorP/ZK6jVaEuVhrfl5dlJWYZnTgsFNwhq0qkEDtA3hhoGlKo4e92+lgYKTLIC84R0 4Cif+tNGCa7G1CudYHB8fQHJLzh1/YdbJIc+GZA4nqmeMzbgrWsTs2bDgrq1v9FyeY1y GMOjD+LrOSnKLpWovxysWgt943nnR+IfvT/e9niDNKSU127iBX28GXluhh7JiiIdf1tL WmuYa759oME99yRnNknKyT4KM3KgTz+pWeUqW2eOzo+/L7PACMHsXpVF2HUcxColtNV+ Wpn9NOfwX7+Quigw6LPg/U1N0CCbOqmiBbC5PgFhuV6QVrUJhbqjef/1i5hn0x1MhNyQ vq4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=e9GFosRQ; 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 s25-20020a632159000000b003c6ae769246si3928213pgm.448.2022.05.08.20.42.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 20:42:47 -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=e9GFosRQ; 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 C18E0B0A54; Sun, 8 May 2022 20:41:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345654AbiEFL0B (ORCPT + 99 others); Fri, 6 May 2022 07:26:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345321AbiEFL0A (ORCPT ); Fri, 6 May 2022 07:26:00 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3D9C1900D for ; Fri, 6 May 2022 04:22:17 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id v11so6006146pff.6 for ; Fri, 06 May 2022 04:22:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=jwgJ3xGvdcAfXK7drFXwrp4QaKarW2SpAQVEU9d/grI=; b=e9GFosRQ6W0+vEOkuO7f9LQfl+KbuYNVkpG/PPZfsJmGJiMLAjBTztTOgE2JzHYkTf 3nUQtkcy3uCk7qsMb/mw7B4JLTBS1p8BGYS6sDtyoLMu05WwYScoOB+a3Kz96/12btf3 rmYyFTa76Fhv+oc5uc46TGLXdh73MgQkkIThVOKWBH+N+uIV8ClAOD4k6aMkDuloDv1q 8C9S/TubxZRxdWv5PRtZo6CzQaKpE/0zsnds2RI+k/jD8WK3QIKpxXBaR5ulnXycVyL8 OHeHbMIswYpmgytQ4ItBvMOzxyBT21vVnrpYSMRwXovv8WMFC8oFfiArYpHUY4kbw7t8 NA5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jwgJ3xGvdcAfXK7drFXwrp4QaKarW2SpAQVEU9d/grI=; b=DJzVueY7zWrnQgbQhb9NM7HGfsHVfQ26kZo1NqA6lUxtQSHz3QDYgxSp5hnHVUNgiO Ji2G4OK6WHOHsgCYChLgnNCTjT4yMcI977MtCs1+Br4YZ3kIcbc4p0yvOJv1/gh/c90t FQvwVnilquc01BvICddWDdBQTsxebW3v+j93rE62KvXyUnuivymvxNrHJ9PllZ4Jy35a Tg3Zn0UUYMIHdeSt1Pn81TiBDwq3MkKRkmv29YZvu22oUUW6CdUae4iTS81ZdifMmiN/ F6d20bBZD4c5WFPZ38cLnYEy5ezjlXCkkGZ0qh/Qd7u54M/DFh/FNycw3L+HlOuN7PwD 5Irw== X-Gm-Message-State: AOAM533GtwuC1OlbeVVSFfGXXoxsT60sjcZxYgoj0yoGOfewO+jH9XiD 6oGGF7OJUHTgY84nBshCn2suGgZNM2BZBA== X-Received: by 2002:a63:87c3:0:b0:3ab:5ca7:1763 with SMTP id i186-20020a6387c3000000b003ab5ca71763mr2373343pge.552.1651836137341; Fri, 06 May 2022 04:22:17 -0700 (PDT) Received: from localhost ([152.70.90.187]) by smtp.gmail.com with ESMTPSA id d28-20020a634f1c000000b003c260491adesm3016425pgb.82.2022.05.06.04.22.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 May 2022 04:22:16 -0700 (PDT) Date: Fri, 6 May 2022 19:22:09 +0800 From: Wang Cheng To: Dan Carpenter Cc: paskripkin@gmail.com, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] staging: rtl8712: fix uninit-value in usb_read8() and friends Message-ID: <20220506112209.hslb67cuinntusuc@ppc.localdomain> References: <20220506071023.GB4031@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220506071023.GB4031@kadam> X-Spam-Status: No, score=-1.7 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,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On 22/05/06 10:10AM, Dan Carpenter wrote: > Setting "data = 0" will silence the KMSAN warnings but it doesn't fix > the bug which is that r8712_usbctrl_vendorreq() treats partial reads > as success. > > The usb_control_msg() returns negatives on total failure and it returns > small positives on partial failure. So take the code that I gave you > before and put that into r8712_usbctrl_vendorreq(). That's patch 1. > These patches become 2 and 3. Ah, you mentioned in previous review "But then another problem is that "status" can be less than "len"." I missed it then. - w > > status = usb_control_msg(); > if (status < 0) > goto free; > if (status != len) { > status = -EREMOTEIO; > goto free; > } > if (requesttype == 0x01) > memcpy(pdata, pIo_buf, status); > > regards, > dan carpenter >