Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp226530pxb; Thu, 26 Aug 2021 01:25:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypmL9pmEs/6wOe1tL3n8BSHe5C/hUpiL1Yqs9vqrqWHo+Z5jyYhPBEvfggrxLlehqMSV+9 X-Received: by 2002:a17:906:1c8c:: with SMTP id g12mr3028453ejh.186.1629966335037; Thu, 26 Aug 2021 01:25:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629966335; cv=none; d=google.com; s=arc-20160816; b=VQhjKHfD+s/ZT/1xVd0abc1DaQu/xvyuEDWtqZ+K0hg5hATOb5yGoUwFaopxgaxsqK OGUfTNESLRglXfjEGRxoN0u+OOvPyOOej+d2w+CPpMccM6JB25i5/Ur4RIXjzVur1ecO MWC0ehMOeUCNv+JkIOATh8wN16DLLC78NxHo1am9IzDCFsQdsyv9PNOwe8SCd/YZsy1O dtkaHbJlhzu/yA5M5BjxtEtf+bwQrum37HJFvnWsc2OOaZ/Imlh0Myg+UZhSdVrGcHPc 9kgmzDGBONLh4pWpuPBZmQcowNZ3au4skiNfao56iP2wfkOGFSF6kaNMif0eKijOH0rO eSRQ== 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 :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=qED0QFjzIUi8lCyfTiUsyzZqylsEfQShOgjXt+9tHKA=; b=uu9bBprk0DdKRs6adHuLwDBitsOu6wxLx8G2+Hf4s87zmnO8mBEN57O4z60D25MaNe 3skloIP/kmC5nBSbzGEtZCLw1KIJHFKlmLAVRQXXrmgpxSlLjCetGLnmUnSytV9PJP9L XMloc9unGRWo6WxGTj4I3M2tHqp+it1xUK3/84Z5vEpheAyS1uppXOIK+8dn27e+LyIU EOgPTYG2wknSg30FrX0GKqIOLyjTm/aroWnzKs827l0DXOnZ2qpmF99KtF6UTMvJzxs5 dLgorwABPI0Zo8AEEjg51lm03sb8OUbHMbCjUrdALaeGFLZjPfbs1fSGrupZqHQvSgAc L3Ag== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id js14si2521302ejc.188.2021.08.26.01.25.10; Thu, 26 Aug 2021 01:25:35 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240420AbhHZIWZ convert rfc822-to-8bit (ORCPT + 99 others); Thu, 26 Aug 2021 04:22:25 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.86.151]:20493 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232992AbhHZIWY (ORCPT ); Thu, 26 Aug 2021 04:22:24 -0400 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-43-ymAybAEpNSqWfaqB-Bjn0g-1; Thu, 26 Aug 2021 09:21:35 +0100 X-MC-Unique: ymAybAEpNSqWfaqB-Bjn0g-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Thu, 26 Aug 2021 09:21:34 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.023; Thu, 26 Aug 2021 09:21:34 +0100 From: David Laight To: 'Pavel Skripkin' , "Larry.Finger@lwfinger.net" , "phil@philpotter.co.uk" , "gregkh@linuxfoundation.org" , "straube.linux@gmail.com" , "fmdefrancesco@gmail.com" CC: "linux-staging@lists.linux.dev" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v3 3/6] staging: r8188eu: add error handling of rtw_read8 Thread-Topic: [PATCH v3 3/6] staging: r8188eu: add error handling of rtw_read8 Thread-Index: AQHXmLmGl/+E/B1vJUGWAidfG7snbKuFdLBA Date: Thu, 26 Aug 2021 08:21:34 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Skripkin > Sent: 24 August 2021 08:27 > > _rtw_read8 function can fail in case of usb transfer failure. But > previous function prototype wasn't designed to return an error to > caller. It can cause a lot uninit value bugs all across the driver code, > since rtw_read8() returns local stack variable to caller. > > Fix it by changing the prototype of this function. Now it returns an > int: 0 on success, negative error value on failure and callers should pass > the pointer to storage location for register value. ... > + len += snprintf(page + len, count - len, "rtw_read8(0x%x)=0x%x\n", > + proc_get_read_addr, (u8) tmp); That is broken. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)