Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3030564pxb; Mon, 18 Oct 2021 06:57:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkdOPn0PtS7KLLEvJnXC0l6yv1yqsp+eFWeHTyhAhjCIz6z1cGUI+KwVK+r3Qyyk5pWGzA X-Received: by 2002:aa7:c44d:: with SMTP id n13mr44937320edr.34.1634565476066; Mon, 18 Oct 2021 06:57:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634565476; cv=none; d=google.com; s=arc-20160816; b=u1RTK7Fvo5gjggD4UJA9SkyyWvkd9wDp5QjPLQ6KjHn2JA/k7hPsGryWvnGApSSfTJ jK8a/gXetJVB67KW3hfepsBI2ergDM5FWrDWnBhyi4vJnsSqPvA25Z3/Yp32R2m11anc 2IwHCLy/q5htrB3FJ8RI0xL4aZrJsraBphwbv+l5f3jpEf6jAkN6QOGfOw41FBMn+FR6 pUYE2cLYUYW+BkZlHrIZ7cn1GCxu/r2piJUxMo16q0tdquPNoGzetCjQy3NeJ+cNvGlo dlxB4ByfczwBvyUJV/Z0+UpduRlFpw15F7UM8ntCBzmOcj6bgtnFwO0K4a4Cdl0xKZXL GHtA== 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=Zokd8jUdG3WNSTCFmQ8BqGGK9H38oKBJB1LIhkhZQV419XX8fiqQbwMkVvsKel6dkl xHryT2LzRPixRwQtt6rQuhN8u4gXjR1dEqW+nKQufObq8uFAYjKK6opYr3zTh9pYuWcp tuYUKn2qeck1LovHv51ApJvmyOswIetw6uKoQy2DxUjnI80kIxfSST+QHGnA0fIQ1K5Q 5gtGRYwhwaApup/kRL4MxxW32MWeAK44RltCN0i3Zn+maX18WTKC/bMMpsuut5p90DwI LYR4UcIf6eUqOoRABDe3HwtddyXHx+PwPtHhwuTTmE7EkfkyDMDMnarrU8k14J7ViAug CjTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SvQXYxxS; 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 m8si22319795edl.0.2021.10.18.06.57.32; Mon, 18 Oct 2021 06:57:56 -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=SvQXYxxS; 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 S234285AbhJRN5w (ORCPT + 99 others); Mon, 18 Oct 2021 09:57:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:58168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234375AbhJRNzz (ORCPT ); Mon, 18 Oct 2021 09:55:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1396E613A0; Mon, 18 Oct 2021 13:40:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634564411; bh=EUB55AvFWO8DodrRnQswPvZgR9JY2IDW6eTIF3qt21g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SvQXYxxSo8ADwLoo+BV6gjbxcKfXnleEv8G0nZ+BREqGbtOWvPJTP51qYt/sNkHmw OH1HgmfQ8FyaIlp0uTLpn7ry6Htb2tG63tRLV5gH+JxgFM3Y9i9mBysVQIoc8cQG4X DXlsgR5FIns4I/gJme66JJADln+py1m3c9KEZofk= 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.14 080/151] iio: ssp_sensors: fix error code in ssp_print_mcu_debug() Date: Mon, 18 Oct 2021 15:24:19 +0200 Message-Id: <20211018132343.288461350@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132340.682786018@linuxfoundation.org> References: <20211018132340.682786018@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]);