Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2104241rdb; Mon, 20 Nov 2023 01:56:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IEEDpuOpqDzJ8XVaU4AOVDb50cPgCpkZYA5mg+36AYuIlZYVaTl1/xNPBe6WaTlpSsBf2wo X-Received: by 2002:a05:6a00:2450:b0:6b6:e754:9e02 with SMTP id d16-20020a056a00245000b006b6e7549e02mr5358577pfj.12.1700474213612; Mon, 20 Nov 2023 01:56:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700474213; cv=none; d=google.com; s=arc-20160816; b=UrCj+M3t4zYuqozJ40Vr6eLvogJ5gY27eDMZNb8u0f8vMP8Ds5Tz+LLPToSGB5l9nH kb7H7Pu4oorRmHB+FyTIxjb9qMuAlCc5dkwRuwtii4FHBlvwhQPxgGvSOpdFTsYfVxSU ZfWgEIALXew417D18O5snzF/m7C9XbkFDxCZ+84ynKt+Ge5vFbgDGNZhQYbTp0uM192q +axiwaxHLRwOKLwWO1/zbXmdBvHzgpOFL5/haMmY+/FlLXwVHNMbkfKr/dJKqWr6VU2H yWgWONdLmCePL74K7CTPE96/yvFvNwxkORcdZfnj38yioI+K989hL3lTTnEYswh/ZqIZ sVfA== 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 :in-reply-to:message-id:date:subject:cc:to:from; bh=xK9tf0qb9QF63EX+JgfAuCxkYiYDi1Ek47RSy8pWb7w=; fh=YT91d2VEuu2z5BuvIej+noZS5lzLoVu2zAiTjXjHj+k=; b=KcMNw5l4a+4xPUaCBw47OIyA1Mx2QKMDKNwA4J8fK5FWhWe1eHt8Fci0z5g/j45Fov jlz7Z6/FcIpdcBKA7vBJ9Mq8bERPW0FcpkhlpKAHrUkUC/UWJqCUY0C8y7fCBZAfBm30 qQsYukaioc9y1NAsis0Q1OiUIE9kCJynhQHs7E3OAtTj02Ugg79Jw6mpR1oxnBec4ZP6 6ROJRlecEQEDQ/NSbw9/K2hZAHRskoV/3eVkZ5mvDcFDJ/zC/Mgh7UZzlatbDzX10bJ3 gdFWsl+62q/HaFB4q6ZQ/V0QkyVkffn5ltAv0kgEZC/NluBmthG1oH/7ThIW/+cz2wOX NMTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id bx11-20020a056a02050b00b005be0a705478si8474785pgb.89.2023.11.20.01.56.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 01:56:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 05541809E8EC; Mon, 20 Nov 2023 01:56:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232538AbjKTJ4W (ORCPT + 99 others); Mon, 20 Nov 2023 04:56:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232363AbjKTJ4V (ORCPT ); Mon, 20 Nov 2023 04:56:21 -0500 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 8E328CA; Mon, 20 Nov 2023 01:56:17 -0800 (PST) Received: from localhost.localdomain (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id BABDD633E6ED9; Mon, 20 Nov 2023 17:56:10 +0800 (CST) X-MD-Sfrom: suhui@nfschina.com X-MD-SrcIP: 180.167.10.98 From: Su Hui To: 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 v2 2/2] misc: mei: client.c: fix problem of return '-EOVERFLOW' in mei_cl_write Date: Mon, 20 Nov 2023 17:55:26 +0800 Message-Id: <20231120095523.178385-2-suhui@nfschina.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231120095523.178385-1-suhui@nfschina.com> 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 20 Nov 2023 01:56:34 -0800 (PST) Clang static analyzer complains that value stored to 'rets' is never read.Let 'buf_len = -EOVERFLOW' to make sure we can return '-EOVERFLOW'. Fixes: 8c8d964ce90f ("mei: move hbuf_depth from the mei device to the hw modules") Signed-off-by: Su Hui --- v2: split v1 patch to different patches 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..9d090fa07516 100644 --- a/drivers/misc/mei/client.c +++ b/drivers/misc/mei/client.c @@ -2032,7 +2032,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; + buf_len = -EOVERFLOW; goto out; } -- 2.30.2