Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp228747pxb; Thu, 26 Aug 2021 01:30:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFId6DUom43AiBOszVN8Nf0gbhJbFOYYUVvM2sPio+fCSHALrnog01ucgV1hiKZAnfm/Zf X-Received: by 2002:aa7:c487:: with SMTP id m7mr3033345edq.62.1629966644731; Thu, 26 Aug 2021 01:30:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629966644; cv=none; d=google.com; s=arc-20160816; b=X2GuIr1I7wwUTiWw7Zz07lnOeeJrXKJN5jK9AuuJqZmSroHdsv7Ke0mQqgw+t4tHPS 0Xm8Cp2+R9LpGd0YVIpp5qtX3jQ/yvwLhpQ0CHEFHcdU2CTJ8x8pKQUomOHgGUl/thb/ rti4JvFfjNC/zBUTU3B+6gkHJMc9x0h6p4vWUhfprMCvRC3eTwhsDpgzwuGttqQacIWX UWBuxVV+c5uwZegUmm7rDo9EFj15JGrHmmfNyB3KL3yzUYaD3fE0H6LvabkqSYYEysbD y8JoAu+ivAKYuxHXZbnsWwbQxCs++ZIZaxYjsmWxjJJkEzaCtKSBcKfOF7+mwN/Dtozy B0jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=I22BlDdo9NBLaeRFYeqy8S3iIoOV2ys2CHWtpTY2vK0=; b=zy7bMYTIdtbQVa2VbLXqSvnClHhNSdviDzOx4cifu9osrHkBwfj6CkPnEodh3TsAHe BwaCfOR6s5AfuIu8M14OYGLod2dJGFv+m9gbQuvYLyH+v/uxRgXNLWUqG49Yq1b1kIvJ Sg2f3pd9Rd4je5TfYKwRUi9nq3zrpKMjhdT4DLyeK4+XJxTSuU+Wd1sp6a14w0ZmYbup EyuPIyfYb2a9omXqY1FSlQ2hDnZm8BrBxoYbFSt3+yI+MpVPbWLbVw7SCYOVdzdhmqHy hDqPGBGp5pxsEpcTADHkjlseL5YN4lDWIsVQCjzbaw4MQx8KYsd2SfF92GvPiZXZun8S TLKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=li7Mxxla; 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 p11si2331004edr.524.2021.08.26.01.30.21; Thu, 26 Aug 2021 01:30:44 -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=li7Mxxla; 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 S240519AbhHZI2p (ORCPT + 99 others); Thu, 26 Aug 2021 04:28:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240509AbhHZI2o (ORCPT ); Thu, 26 Aug 2021 04:28:44 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33DF9C061757 for ; Thu, 26 Aug 2021 01:27:57 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id l18so3611593lji.12 for ; Thu, 26 Aug 2021 01:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=I22BlDdo9NBLaeRFYeqy8S3iIoOV2ys2CHWtpTY2vK0=; b=li7MxxlaeaAuPlGb+aX1Mw9qv6/EFfwBgzndlcYeoHKE/P8eMm84cE0oHjDqWZi7ra soDt7TZRJaj20HcOeLWPGkwEUwmSw4Q5Zg9AlEsB9g+vdd0d2RD4DUCaK0WS5/ICtknO itlYU18B4aHZ8mjCt64FSW6V25Q602xyfTBgvrAnqyLv2MiFsyxz7oa63MKAUVuOWxmN 1AinWfR8nZU+DQs739jUH3og3WzKESLnZh1aMEXBQbaSc/psy2yhpzPjnZ317miSnI8w IdQl2zgMwqYCb+TGGixEloZcxj5zlSaTVJ+bl37JsVJS27019j6rkaL34xldC/ORJMP0 +duw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=I22BlDdo9NBLaeRFYeqy8S3iIoOV2ys2CHWtpTY2vK0=; b=ohBubNN/VCINqjXqMRqc2NxFy1du6CWBrRi+72iulFxu73xE4BS5sjzpwg1g/9z/4l CVNFsFTKyR2OX7qdB5JngLp6AXOdIGx+HMngrj+jID25AVutz+Qybrvx22C6rtcqy3ff aBDT8ySAsKveFI00JyFTRvSV+OeG06dxbGYYuUUHY+VsNonXOEbkt7gNxMSA+80t/I/m 55AuHqFW+dti/ZiS44THASBo+QEEfsSga8TqWdPQAgnnOObjLknnf4p03Xlld1S/027y vaO4TrYbdoEgnk55IlsCvke255kZGPXfBkjxg0GrCUtg58fseDE7R+6uIcRrg1HC4XPh g41g== X-Gm-Message-State: AOAM532457CmY9Us3+muHn5dWKnREIC++nY4UQlhD7RHT2W8ow2h8xq1 kLOaVfD418FHUsXPIBE1kF8= X-Received: by 2002:a2e:a4ad:: with SMTP id g13mr2000903ljm.391.1629966475289; Thu, 26 Aug 2021 01:27:55 -0700 (PDT) Received: from localhost.localdomain ([46.61.204.60]) by smtp.gmail.com with ESMTPSA id w27sm245479lfa.308.2021.08.26.01.27.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 01:27:55 -0700 (PDT) Date: Thu, 26 Aug 2021 11:27:45 +0300 From: Pavel Skripkin To: David Laight Cc: "Larry.Finger@lwfinger.net" , "phil@philpotter.co.uk" , "gregkh@linuxfoundation.org" , "straube.linux@gmail.com" , "fmdefrancesco@gmail.com" , "linux-staging@lists.linux.dev" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v3 3/6] staging: r8188eu: add error handling of rtw_read8 Message-ID: <20210826112745.5e1421ed@gmail.com> In-Reply-To: References: X-Mailer: Claws Mail 3.17.8git77 (GTK+ 2.24.33; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 26 Aug 2021 08:21:34 +0000 David Laight wrote: > 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. > Don't get it, sorry. Previous code did exactly the same thing, but didn't check if read() was successful. With regards, Pavel Skripkin