From nobody Wed Dec 17 11:00:29 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55D71C4167B for ; Tue, 28 Nov 2023 01:45:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232077AbjK1Bpr (ORCPT ); Mon, 27 Nov 2023 20:45:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbjK1Bpn (ORCPT ); Mon, 27 Nov 2023 20:45:43 -0500 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 39E88138; Mon, 27 Nov 2023 17:45:49 -0800 (PST) Received: from localhost.localdomain (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPSA id 946E9604B3FD4; Tue, 28 Nov 2023 09:45:36 +0800 (CST) X-MD-Sfrom: suhui@nfschina.com X-MD-SrcIP: 180.167.10.98 From: Su Hui To: alexander.usyskin@intel.com, tomas.winkler@intel.com, arnd@arndb.de, gregkh@linuxfoundation.org, nathan@kernel.org, ndesaulniers@google.com, trix@redhat.com Cc: Su Hui , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, kernel-janitors@vger.kernel.org Subject: [PATCH v3] misc: mei: client.c: fix problem of return '-EOVERFLOW' in mei_cl_write Date: Tue, 28 Nov 2023 09:45:08 +0800 Message-Id: <20231128014507.418254-1-suhui@nfschina.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 mo= dules") Signed-off-by: Su Hui --- v3:=20 - using 'goto err' rather than 'buf_len=3D-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.c= om/ 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 =3D mei_hbuf_empty_slots(dev); if (hbuf_slots < 0) { rets =3D -EOVERFLOW; - goto out; + goto err; } =20 hbuf_len =3D mei_slots2data(hbuf_slots) & MEI_MSG_MAX_LEN_MASK; --=20 2.30.2