Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2665705rdb; Mon, 4 Dec 2023 04:22:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IFESXyxfiV+Xe6InTw+tblJiNkgpDCo2nzCvvkM/BnQDNAJhJK7EqzBrEy7hZaRQC2p6DSP X-Received: by 2002:a05:6870:e88:b0:1fa:82cc:3d13 with SMTP id mm8-20020a0568700e8800b001fa82cc3d13mr4952980oab.16.1701692558121; Mon, 04 Dec 2023 04:22:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701692558; cv=none; d=google.com; s=arc-20160816; b=jSiV/oTJsYlkWvH6tak/Bp4Be2UZBBZ2cWRZqIkEnThqWu51UqcD88hnm/YX/zreDy I/FEWiIlXu4zxjYE2TAu85dg63YxsY34hEZvtfFuX87YxIW68wz+PhN6eSF585UjXyGa /r0WudMQT/lp06PmBh3V3KVJACUiP7DLE8j9tiohCEAfMqFI7Zi2rHKy/ECxxAAcT29X GVc4h1uHzEhpbWnNXUu5bXJyaAjyityS+KHTRB4aSOhNDE1VQnE+4nrUyksgTEqGuGl8 nWHVlwEOEW1uRRKgmODHA9aQ2Wv+bCzHhpdUgvv0T6wRuUNNuUd6nDw+46zgtJO46n3g 3vjQ== 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=4PnA9Ey9N5YzofxrnD2/jH57kPRRUQu59Pf5Dx3gHzE=; fh=h+4aVKfL1m4gnPrJhXSNy66vfVt6d3qaDwWvgsiCC7c=; b=tgbg6dMZMubqy7PeAz+nA7qpmdInbyNnp7YCUm2sepVTFNiZsM1mpm3BeI3yvGbxJt Z8suTQ6r8dgP8iP/8BczE+J+YA7ISjeXDaTN8ihrnjO1hlSJHu76+/GVBKKT2HgCos7M lsPibH/77RKEB3xaNeCHUtp49hqCen2GTS1L4Dq82oWp3qjxohWlBIb910ctvBZqFY6x JSgiHDfPYrBd2WSKU0pH5I3sltMzw71ST014804ggge0tBkkhkG+UgdBWvDC6Rrh98XN dqZ65ohITjDczyhXvjaCxGnXzHwb+zUDE1hT2k0ePN/WE3hnG+gxkamPmBOAaPccqjMT qPFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KiIj8OFD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id 4-20020a630204000000b005c65d99187asi3946999pgc.140.2023.12.04.04.22.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 04:22:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KiIj8OFD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 34816808A8C4; Mon, 4 Dec 2023 04:22:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343801AbjLDMWR (ORCPT + 99 others); Mon, 4 Dec 2023 07:22:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233118AbjLDMWQ (ORCPT ); Mon, 4 Dec 2023 07:22:16 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F755FE for ; Mon, 4 Dec 2023 04:22:23 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E9F6C433C9; Mon, 4 Dec 2023 12:22:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1701692542; bh=VBhrN1iPpuRyzjKXqxjhhLRiYuFI95GVYxgoft4cV+8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KiIj8OFDtFDuB6JKodOOuVAdXP362m2FJeoPh4PXXfCfZObsP6HzgR0U9xs2o9KEv OOLqGlRWqIK8+dnhNdyUJEcp6yfR/5BdPP6qIF4bZJ6ry3Z41iaGeOf66n6+HP09M3 4qw6jBXbREaIeogan0AmKBRjd0tnPBrBcXKDhTdQ= Date: Mon, 4 Dec 2023 09:00:42 +0100 From: Greg KH To: Su Hui Cc: alexander.usyskin@intel.com, tomas.winkler@intel.com, arnd@arndb.de, nathan@kernel.org, ndesaulniers@google.com, trix@redhat.com, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, kernel-janitors@vger.kernel.org Subject: Re: [PATCH v3] misc: mei: client.c: fix problem of return '-EOVERFLOW' in mei_cl_write Message-ID: <2023120452-stool-party-bf2b@gregkh> References: <20231128014507.418254-1-suhui@nfschina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231128014507.418254-1-suhui@nfschina.com> X-Spam-Status: No, score=0.2 required=5.0 tests=DATE_IN_PAST_03_06, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,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 agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 04 Dec 2023 04:22:35 -0800 (PST) On Tue, Nov 28, 2023 at 09:45:08AM +0800, Su Hui wrote: > Clang static analyzer complains that value stored to 'rets' is never > read.Using 'goto err' to go to the error path and fix this problem. > > Fixes: 8c8d964ce90f ("mei: move hbuf_depth from the mei device to the hw modules") > Signed-off-by: Su Hui How was this tested? > --- > v3: > - using 'goto err' rather than 'buf_len=-EOVERFLOW'.(Thanks to Sasha) > > v2: > - split v1 patch to different patches > https://lore.kernel.org/all/20231120095523.178385-2-suhui@nfschina.com/ > > v1: > https://lore.kernel.org/all/5c98fc07-36a9-92cc-f8d6-c4efdc0c34aa@nfschina.com/ > > drivers/misc/mei/client.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c > index 7ea80779a0e2..0489bec4fded 100644 > --- a/drivers/misc/mei/client.c > +++ b/drivers/misc/mei/client.c > @@ -2033,7 +2033,7 @@ ssize_t mei_cl_write(struct mei_cl *cl, struct mei_cl_cb *cb, unsigned long time > hbuf_slots = mei_hbuf_empty_slots(dev); > if (hbuf_slots < 0) { > rets = -EOVERFLOW; > - goto out; > + goto err; Please prove that this is correct, as based on the code logic, it seems very wrong. I can't take this unless the code is tested properly. thanks, greg k-h