Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3541084rdh; Mon, 27 Nov 2023 17:46:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IFWrc/Pn1S3sGKA1YCExheIkKifawbjmol8n8SjuILIKHzVfwiGsz6T855OxGtFKTTQtZUf X-Received: by 2002:a05:6830:34a8:b0:6d8:28f7:75ac with SMTP id c40-20020a05683034a800b006d828f775acmr5900417otu.35.1701135988722; Mon, 27 Nov 2023 17:46:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701135988; cv=none; d=google.com; s=arc-20160816; b=xMnzu3nkKtB3vFXq6UZL0z7n2zm1SJKOeJMUUKlwOo8QhaORFka3b/rSpGHUMSXuZd ommr41Ow2C9pS5KWPoMQ7dR39UwDgEGAGWD2pdzNUkgsOYTFOIKBnxku5uHZLuero45N XLy50RNJFOKFeNiAqftMTdS2YzP9znIPGJf83rnnUtdkYuMMs2OdogxDT8XDN9GzRpvQ JhOhErzoFgMERZVoGpkvuGtaicYDcKNuE8MfFov3h4p5+GQqQnvDidN8nFWyPFij4Dxl aGKvSjz+Sa2qfF2zr7TOHgPmm9ZyujKpP6Dh0snsYeFH86seNlJF8P+LidFpGj9l7Zo+ b87A== 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 :message-id:date:subject:cc:to:from; bh=M93grUKtUcMAa59UysqAROcY5d0giiDnn/VkJCyq1zs=; fh=GEAyWyGxCSNcAv1qxyPZt/iPC/S357maFcqFsg700+o=; b=MAHQYNcPdBgpUjmNrgjGps0XQ+1eKhINX56uqSHB76bEPihpuL6sPsIEeLgqN0XbDR qh4fwzxlztieViV6Nmr4sqk69dBwpfX0HelP/THdmyWBOS6eRFmGHfxUZNvuh6av5W3h vXtykPekWlUqpPCAhi2iNyJoBDadVLJlyGoi+j5Wg24nPpqx0t6+GQsjAjGALOF2Lff6 l1vcZpDVxJCw/MpIHjPaEV62MT9/KUO5JUhGN10re9MnwntQjo2YIG/qQ+35iI7oK9Xl uzVO4atqu94qA8wLHIvrWnK2X735n+fpj2tq4c7ngUrp7FOlEj7wgwHLV/2fPvde8rO0 n0/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id q204-20020a632ad5000000b005af44ed3148si11217383pgq.367.2023.11.27.17.46.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 17:46:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 424F581904CD; Mon, 27 Nov 2023 17:46:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231954AbjK1Bpq (ORCPT + 99 others); Mon, 27 Nov 2023 20:45:46 -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: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Mon, 27 Nov 2023 17:46:26 -0800 (PST) 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 --- 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; } hbuf_len = mei_slots2data(hbuf_slots) & MEI_MSG_MAX_LEN_MASK; -- 2.30.2