Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4836415iob; Mon, 9 May 2022 02:48:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqoMerikmlW9hT/j/79IKz5uCkSrbX4Z2z63CEgftLPovlj1+3btlomtrNEZ4+cGPXZ0S4 X-Received: by 2002:a65:42cc:0:b0:3a9:f71f:33f9 with SMTP id l12-20020a6542cc000000b003a9f71f33f9mr12487002pgp.391.1652089729912; Mon, 09 May 2022 02:48:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1652089729; cv=pass; d=google.com; s=arc-20160816; b=k8L078Yhm0gkS+YR230PmAGUcD2QLFLrN0L1HvvxuIa3Lj0bjpJxOpxx4/X0gAVZFz yyUxaaIidozJ/19+MTE8JZTa2I+6ZSLb84ZoE5WjniKDID33SNs39kX+DqdqNMNozcsU wjPIRhs01Nekrg+FXIcr5jPxYtdtgbGLZVMbG9fNsZwgebk0BHNu8aQpO7ADFbdIV/+8 xSkMO9QzI3BULORJBG9Gi6cYKnirzt4aTuAOZMmQe0WMkCVTYR6Oum5eRcZrtjD6fpQL efzIb/w66GcxRsT6jGyllfjox/HodElkP9eFtUtpv7ceU1EyCa7NY6pjSNPb7+M5ejBJ rDfQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:in-reply-to :content-disposition:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=neMvv5rHRBpMvbDM07sFvuxo2q7ZdyOyEAf4cYg4wjc=; b=MwA9O+jsAcm9UjrwL05KrbmNlWiAOpxVN+n6iTg5VthL8VJxmrDTCIGjMU8o9IvwF5 d1qKvxzZtfb9/ukTRYQ+8wpISZcPybbn7iyUimB6DtuvIHemUJTcxu6M0kmtOs71AtHI /SwDXaZfw69M1vUct4AsL45113mn+6jVRJRsv8rbcNWv5iOD8z8//9RvOQzF2yy4oGVK E3AKOcxE1EEHgnU3AzxD3WdPk8iRUzJH5EVpeazHfnF/O4ovHl2/BiRwqr2WkgXI3KsM ecRDHtveFdRDcvwGm2pYmP5rL/buVoGz8sLVNx9b+0FwMPD6dZkSV5dHqSJNZ310wf3q R2HQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=O9e9ANTM; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=ORoYfaDU; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); 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=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d7-20020a170902cec700b0015be178cbf4si12295929plg.188.2022.05.09.02.48.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 02:48:49 -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=@oracle.com header.s=corp-2021-07-09 header.b=O9e9ANTM; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=ORoYfaDU; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); 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=NONE dis=NONE) header.from=oracle.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 335D2215528; Mon, 9 May 2022 02:33:58 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1389416AbiEFHOk (ORCPT + 99 others); Fri, 6 May 2022 03:14:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1389397AbiEFHOg (ORCPT ); Fri, 6 May 2022 03:14:36 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6107B66F83 for ; Fri, 6 May 2022 00:10:54 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2464HLCa004338; Fri, 6 May 2022 07:10:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=corp-2021-07-09; bh=neMvv5rHRBpMvbDM07sFvuxo2q7ZdyOyEAf4cYg4wjc=; b=O9e9ANTMCpnFxD1w+xeUMeuHoUW4M+iwPXTVAxCyIkdcp63twUD7jaCSlVffoJHMBFRz tu0Io9FSlz68TXNkRtwshHHnwRbwDtR/ImzDItufFpnRE7QT5/b8IJ5kakRoklEsdlpQ l7vc5Ea62ds0D5zY0zqbc1GWFQzZFNKUIZEhqLL9NucDszQEI9odTZCw9e2cFObZ8mqx Z/tUJ0JASG9Txhg4b17DFVejCVEfIqcg/hp9/4MqATQ8MZ4BsLyDG2Cmzi1wQy/8IM2D rvXg0Q4Jgd6SJis/ULzslTNBtkic6U9m4RkA7I/AZbZ/fs3jDRwLffiMjhlu5OeEwTHA Yw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3fruq0ncnn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 06 May 2022 07:10:44 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 24676bqU015935; Fri, 6 May 2022 07:10:43 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam08lp2049.outbound.protection.outlook.com [104.47.73.49]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3fus900pwj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 06 May 2022 07:10:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SdZV9XH6K4ydO3r0YMeP9MV+phJud646HnsfX44DmYuW3ErfnenyWu+4IoJvoS7+GutEEbCm7Z5f7YzeGlhcJFQ4pJnWwTqnng5u2MpoP47H+xFKFoWF2zHGTFNW0QbjKS3BLDHbpnLcD3lo6BOLZsqBl7ujcnaesqnSKVCbvR8sKxzOl/avt6eeCmLpM6MDxgHSDZs10Cc7jpKNPU942hhlaprkrcPEaNkHfISBhOx6kMwTZ3Ahsqta0kXDAD2RWUNKbzUni3ExD1pgoKVV8pRQLiEf4+/WG1+CYmw0qSNkycT5ex3eZ65gsvzmit4dvc6mV63ISpWN2KhqEH8QxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=neMvv5rHRBpMvbDM07sFvuxo2q7ZdyOyEAf4cYg4wjc=; b=MmaE66Ke+2bDup6DEyyzh1GNpDcU38yNG7henCdeVjzIzNfmgE2DvnLeHmTe3vf57JIA0rM+EijgqbYcdIwTXv/JeGwpJUmxFJbtQITf/RL/X0yay0Vqfrp2FTBVIbguBaOMIxrnHnQ6NoPlTlNGHSrxAmRwtYJPg1QHCtOEJC4oRKZwt8YgdkZmSQpaAvm8i3BMN/6Gi7pAFLucYtM/SDLKcdDr/vmoiHpuxjmMlvswkt+2p05fwzIrRyZfY8Fnn674aIV9a6lOAMOCKK6URRvwcaftaI1+qfLK4EBTCQ0tEldt1zFQw8FuALkNSpzNwVGgny4n0pOtb6NBHNbAug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=neMvv5rHRBpMvbDM07sFvuxo2q7ZdyOyEAf4cYg4wjc=; b=ORoYfaDURGzDPGPJRpIcm6XtXRLsZjTg3yh1zTDMSyUDeRz/mNNN3N8bmG+Ca2sDWrzOrL8GR/cppICst9sbky6k7dHKf1zi/hJ4Lam6zVSaAci/CeWtlHfxxxHNiBp1MNnB+RbTQhfPHCJN7gZnXiaUYv7xDdQPvSltSELQ80A= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by CY4PR10MB2022.namprd10.prod.outlook.com (2603:10b6:903:123::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.25; Fri, 6 May 2022 07:10:41 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::c053:117c:bd99:89ba]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::c053:117c:bd99:89ba%5]) with mapi id 15.20.5206.027; Fri, 6 May 2022 07:10:41 +0000 Date: Fri, 6 May 2022 10:10:23 +0300 From: Dan Carpenter To: Wang Cheng 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: <20220506071023.GB4031@kadam> References: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: JN2P275CA0011.ZAFP275.PROD.OUTLOOK.COM (2603:1086:0:3::23) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ab8d8ceb-a5b0-40d0-a8a1-08da2f2f875d X-MS-TrafficTypeDiagnostic: CY4PR10MB2022:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NpZ1Ue9SjkyTheiBXu0F/+EsO/hCPnq5+W3zQPoVOTO1Vp9+vADlLTF3r04k8W0N+14tsOFRwkHPdIZipNRh7PYK3TtfVm7t7NsNSFSAtBIEnH+N8pL2KdzMWRpHDbJ7bYx7uW3nIXLu3v76jbi6qSr/FmG4DmAgB/E6WEH2wni6rmRH8+IWqU7s50S0O+TMi4/jwuFKeSBcQvCruot2kj39d7HmaNv3fydFA2zXikocEpfvyXfpm3eM/KFMj5k4JFlf89xpalszlB8+wKWqk1+oyuGy0C+7gNMPwujLYbPR+XdO7XaWUFpS5KcPJ11b46VOslHjQEcdGSlAi/tWr6KGxGAd1C2JKE00okbfIBEiY4UsGd0uLEzEKGESfzbf3MOYXefK+DnE90QbGjZkY54nN7gtHHe7eGLlaXlXQwfzg/7sqg9z2w1k/G4MH1ofC/CUhY6ImuAZSMWX3/eUm1ghe06V43TsFRo9ZIA3VdIo8m5YPnKuyYIenrIphCm1klNtbW2XKvYPDUIHJUIqien1gEkYMCWJ7FteJCM73lYZS6+Dv4rdC8G9Pq50vdoxrT+7Vj1tEDejhllWBlx3OzJRgsJq5gqmD/dICScegQq33e+JcEG6QUD517M6KjTqS9AhrRuK+y4bg3BITUdGbhNs+LPCX4/FO8Be3+1/s6JdgKLrxnoOuI1dNakpyRCLxudqaYU4uLty73XNlNsvEw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2365.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(7916004)(366004)(9686003)(26005)(33716001)(6506007)(66946007)(186003)(6512007)(83380400001)(8676002)(1076003)(86362001)(66476007)(66556008)(4326008)(4744005)(6486002)(2906002)(316002)(44832011)(508600001)(6916009)(38350700002)(38100700002)(52116002)(8936002)(33656002)(6666004)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?4XPeRCukjnVVJwr4Pw8HQ1c3zbNziXjJeF4G0Wccrgbj8xLT9aI77j3jUTQO?= =?us-ascii?Q?0gHFRDU0KNPbVyhtS6iArLhfTCpvXvnvq0NG8rDApppEGEGOMH9pUM3mU8ot?= =?us-ascii?Q?U0pshqeCs1aHiDWxiAL0Z9AUDuAjSg/kvzb3io9AjtTJfIyg/6zeG2ytZoI/?= =?us-ascii?Q?EVKvz1SOD2U73qB6RpYM6M8UUWdgtV5tKahJMbetBH9h6pEp+GTi5d9+hC5a?= =?us-ascii?Q?oecz8y1tGNv+5FFcrJxLfMPXW4dDvPhnu153Llje77h78yon4+d7Rtaj0h/b?= =?us-ascii?Q?xMEaCBEczHRcM7XI1QxtWu2IPIAKY/s+upGWfr0yHLRrF+50R0JW/AhQRZyO?= =?us-ascii?Q?Xnn+EfwW9Avp8NuCcSDlLCWLeuOQGMP1fAQ7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JXUycjDXTyztmQMxyqAHJMw4pzLIj/g/p+l6fqawFpZ6m9ECLXdfdLe3W?= =?us-ascii?Q?g4qwY5FJSC61ePJP8tIaIn42Sl7IEnYyLyhhNAwaIVw5sRKyRSZmvewc4yOa?= =?us-ascii?Q?Snt/fJfWGD/AF+XkCtIMFxZ93NyFU1rboCqCyh53xnKgFT+UXM6cM2YLiPjg?= =?us-ascii?Q?N9P13TowIVAj2IXNE8BfiYW2ynagvWfVQUdRkgf91cditD2Pw/+gtvwgssil?= =?us-ascii?Q?12e+tpy3CH1xa6LVy/C0zjeT+hnsT1lxowN21p0RLeV7s+d9x8Icpt1+bfKy?= =?us-ascii?Q?WVjvNsX6O8SI9ltoGnd4t1+p1fHgrUbY/t9ZO1M2UooqwQuuc0TffKg0nX2V?= =?us-ascii?Q?KHAOG64qglJtYt4k3eMabqaHkQcvkWPK3O5CC63Ml5uBqIIutYxQ1r2cDGXg?= =?us-ascii?Q?v05NSkhMGJHeUD8lZ2FmC31fVG2QkdgUBZGIpotqKYPV456h6ZBh6XpJKOE/?= =?us-ascii?Q?WjaCzX5rtvNC6dBUuvef0+r+R48cSsc=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ab8d8ceb-a5b0-40d0-a8a1-08da2f2f875d X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2022 07:10:40.9564 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qJTDVQOsGwxg2rv3zOfRfP8rCscaOBc5nv+wKHhbIgdc5Hn3NXu3tbPI9O88oOApqLwMu8q2BUqC3z5yG4utI2qh57Wsj6oWhKSn2zU68O8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR10MB2022 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486,18.0.858 definitions=2022-05-06_02:2022-05-05,2022-05-06 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 mlxlogscore=956 adultscore=0 mlxscore=0 spamscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205060037 X-Proofpoint-ORIG-GUID: hGQoGcPA8nMYWgoxIn3TDR2GGDOTdnkJ X-Proofpoint-GUID: hGQoGcPA8nMYWgoxIn3TDR2GGDOTdnkJ X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 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. 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