Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp608945pxb; Mon, 25 Oct 2021 14:54:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkDfS+zoAh0cMtVh3TSP8S4MKjcKMEHRJNDvrk/tWJLaVdEfw3CLKYXIVedsK2M6GlsO+2 X-Received: by 2002:a17:902:8bc4:b029:12b:8470:e29e with SMTP id r4-20020a1709028bc4b029012b8470e29emr18824631plo.2.1635198849781; Mon, 25 Oct 2021 14:54:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635198849; cv=none; d=google.com; s=arc-20160816; b=Curp5biN87Fz4Lr1sMLiLbg2EeXCnHgqox6yEkmIdn7FjU8XrOPfR9hf3DkIoinTG5 jn97ppPB91BiPnrXPvwfzkoWbAkd9oBWNXni/f4XoGcusfBwKf0/3rwvHXTz4Uu53wFv 7aLjsW/oCqrDnmh3Jo7EldOKX6chEUeJBxG5h0OFae2AjcvLEwQSzeTsb+8anzLvSDmo Oo0EUq3/gOEuAvArAJcwplG8p+tvR6ttTuyUnAslRzsuJSYYGjafWpN/8OdZpTTmBjys u5b1IZwxkvIvGwiLBfUUky5MM0mBJCZqz5JJqW3WIzcGWvTSF+JqBz1zT+f1QC5vNBzT PScQ== 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=XptYRLIK2CLKZYD6q7Q5MWtH3hHD18UeRz1Xj4pVOH4=; b=BaRAfS6FMySBsH+zaobGZbqbhN4Zv5hJgt81R/AJ5vJg3G/SmIAyfiD1eFRYSWwipQ ShZJc1a+QZ2H4OULeb923jjSSyLSU8BSAoviqzpDDFW3IjkDeaDgwbijAMm5ki92NfYu aHKpYLllCpu0a/nHUsEGHXCcD+PT5tHX2nEPfNdAUADhGtZJSXNRlB+Co5m+CH3oaT4r IQNME9OeUF26tVHpMRiB/KzJ/YrZr04DtLp9nFpGazU9OQbaq7Zcw77kRhK7DM7NotxC IAy9PqI8VvlXtPWVxHS6AJIFQ5BGewrvxyuvwAIc+doRfwR7FfKTh2TW9iC10xN5Jq2i 5qOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qGxYLCO9; 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 b16si25675688pls.193.2021.10.25.14.53.57; Mon, 25 Oct 2021 14:54:09 -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=qGxYLCO9; 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 S234366AbhJYTS2 (ORCPT + 99 others); Mon, 25 Oct 2021 15:18:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:35532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234441AbhJYTSJ (ORCPT ); Mon, 25 Oct 2021 15:18:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D2538600D3; Mon, 25 Oct 2021 19:15:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635189347; bh=LJlDaRBgePqAvT2+QHa8/PRFb0ox9bnspEkX9m8EXJs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qGxYLCO9kfZxTGYg+Q5AO2zq89FZQ1qAm465HOq/QgqnKuXBPfR7Oa7JUiZp/A4+K WHk3WUVCZ5kwzG03jVZF7658k4ldflAObSrU3mFJB8SE9/KGVqth3KVUB6c5t8JA7f AcTgjOPQhnqMiwENM9fdtHVwoNN1lspeNkklTDxM= 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 4.4 12/44] iio: ssp_sensors: fix error code in ssp_print_mcu_debug() Date: Mon, 25 Oct 2021 21:13:53 +0200 Message-Id: <20211025190931.152656708@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211025190928.054676643@linuxfoundation.org> References: <20211025190928.054676643@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 @@ -147,7 +147,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]);