Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3015024pxb; Mon, 18 Oct 2021 06:38:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuoPhRgd+TBk6DzIiY6FEFqy9Z3ImxN4HxGo9p+7YIDnR10FelGAmr2XZz/MphKl0QepQG X-Received: by 2002:a17:902:f691:b0:13f:2034:7613 with SMTP id l17-20020a170902f69100b0013f20347613mr27319679plg.81.1634564316930; Mon, 18 Oct 2021 06:38:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634564316; cv=none; d=google.com; s=arc-20160816; b=iWxCutzSm72Xg5WwnJ8NJPphH0V3JsvqeyyyeWljBbStoepyhDOa322LEtccP9nubt Q1Cdxv9mdBS6H1D+/oZ2q9Ssv07g9KRsslpTJXGvfB3OaA7dLiCXnMbpHKB1iZfgZtlI I8mxP5w9WTlwmEERg3fFpLlhDZ2VvlUOmbWOgxnhMY0KIKmLBPuc9kkGNBdx1H6xqh1Y YxkFdvY6Jm3m4WV6Rvla48RDeE+za8+Va3E2a3hUK9FkCy+PRs2laAnc1xSsq1nO5XEU LIujFSghML8HTWIPgFPMHpYevYXQSZHBENXqreQgydgY9AewczZ3djsN939/rVkiO1r5 XSjQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gmKeBO4wYDH8lFs9+N0j5P0NTeW0AdcX7BTpSygL5Xo=; b=P7sfgKYn9NC2+g2WVJR/7l+wjVHiMvZyqImAz7DunE0zSga0154JIPkrgXVJKhU6UL oIBBpsUHfpkl7sIE8SrT9P1VHV6giBcISvMsAkSCzqCc7pMaHJJ047s5U+dxaFmrlFkC EzNvbd7z0ROprkw/qZ8K9FSWZvsdLdDqUMd2YiEpJoy1+++Rbdgj7kMeNagprM5Q7OvH Ra8RE8aCUFDGn2ThoN/9GNshdE5yU2RXuf//842Zucloy4vVBe+1HQPriQKmbWVAykBM 5S4gjOY7feRKC/3/6WwZv+9AS1vSVshxhKZ8cSHDCVymmaEVP9zsIqheywMN+y1JibO2 5eOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FF4X8ScV; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v12si3062119plp.293.2021.10.18.06.38.24; Mon, 18 Oct 2021 06:38:36 -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=@linuxfoundation.org header.s=korg header.b=FF4X8ScV; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232645AbhJRNjN (ORCPT + 99 others); Mon, 18 Oct 2021 09:39:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:55246 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232991AbhJRNgS (ORCPT ); Mon, 18 Oct 2021 09:36:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 619C261260; Mon, 18 Oct 2021 13:31:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634563864; bh=EUB55AvFWO8DodrRnQswPvZgR9JY2IDW6eTIF3qt21g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FF4X8ScVSEAEDSskTFln3gW0IjZ9vCt04GswdAi8MYyzJZWnNUatlxghj6mQ9FOiv yQ6fQVV1dsIeQL+ZQIZVE5Pak0Sg4eMU0kcBkekjS9hERRQu8EqR9wZ4xMJfx02XeU lL3FXYpu6maWY9fCH78SZ1uIGWHfbeBgCmuwkEvo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Cameron , Dan Carpenter , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.4 43/69] iio: ssp_sensors: fix error code in ssp_print_mcu_debug() Date: Mon, 18 Oct 2021 15:24:41 +0200 Message-Id: <20211018132330.902148079@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132329.453964125@linuxfoundation.org> References: <20211018132329.453964125@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter commit 4170d3dd1467e9d78cb9af374b19357dc324b328 upstream. The ssp_print_mcu_debug() function should return negative error codes on error. Returning "length" is meaningless. This change does not affect runtime because the callers only care about zero/non-zero. Reported-by: Jonathan Cameron Fixes: 50dd64d57eee ("iio: common: ssp_sensors: Add sensorhub driver") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20210914105333.GA11657@kili Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/common/ssp_sensors/ssp_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/common/ssp_sensors/ssp_spi.c +++ b/drivers/iio/common/ssp_sensors/ssp_spi.c @@ -137,7 +137,7 @@ static int ssp_print_mcu_debug(char *dat if (length > received_len - *data_index || length <= 0) { ssp_dbg("[SSP]: MSG From MCU-invalid debug length(%d/%d)\n", length, received_len); - return length ? length : -EPROTO; + return -EPROTO; } ssp_dbg("[SSP]: MSG From MCU - %s\n", &data_frame[*data_index]);