Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3133697ybi; Thu, 18 Jul 2019 21:41:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8ikcVNHS0iCgDzqmfSYBww3Ntj+lBpplAMXON9bUzUVTTc3/BdZ2GAgnwH982Hzu3xjrE X-Received: by 2002:a63:7c0d:: with SMTP id x13mr12351168pgc.360.1563511283336; Thu, 18 Jul 2019 21:41:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563511283; cv=none; d=google.com; s=arc-20160816; b=K2+SjIlxi65o3PB8iGdE1NjzFqQlsBXD/pODn9VQhRxRsTwv9RJkuMGPM8dGfnisMF korx+FUMB71r0qjR4oKmPgSoNK++PdRV7397//TqS4AXHSZ6hg6pA/KuXodymsM2aBu7 iJUCm0VVwvOqogI4OnE9zKKvwIXpG1E9Q1v6S43tqbdtZ3MmmuC62PTdiAQwDvPTmo9i nDvabhto4Hs3b6f09iTjWfzj7WBARXZl21aLbr/jUtQZqYgvgpCNhYQpQG6q/oginIfw fExQz3csfbMZkaaXREE7oTSXXzpUsz5kgKBT+U5Kq7Tvm8ZBV+PphvU/bcQ3uROPauFd VAJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gcNfxqHZL+o+ZlJYpjg+oXbeTBHRCAsyiz+h2TfrsMM=; b=i3ai/2QNEtiX02GwiAjg7Pmr54Eg/oeM46s0bVsKWWtySGtwDxn4BbzAdEXK3Th1xM 9CJRVP/wyJ+GgnFpPHsSGK0+1nO3DixRojs5rW5+1xf5b8+0VtmlDDBC+Oo2BkaJvJT3 I1HsI5DMMKrYdA7l2j9vQILZ09q+0u8SeFnvy89/nKRSLhX3NV6pLx3K0mJWXFWpHLrn 4dtRU8SCB6yyYp2NTN8Z1j4ai33mrwyOrGi0sNNNdsO9rfSOOi+AxbIumQU+xf/EWfUE Jb0lL+nKjH/9a/Etxrbjk8AyFDuZnAkfTkrtThbQPfch9KAVuW2fidfsNNbEmzxsVHgj RsNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="qbl/3kOy"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x9si1269788plv.182.2019.07.18.21.41.07; Thu, 18 Jul 2019 21:41:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="qbl/3kOy"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727807AbfGSD6L (ORCPT + 99 others); Thu, 18 Jul 2019 23:58:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:57330 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726243AbfGSD6G (ORCPT ); Thu, 18 Jul 2019 23:58:06 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9E69A2184E; Fri, 19 Jul 2019 03:58:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563508685; bh=Ne7t7tCO1fPo06Q6Oa5jA1SUrTDIgzPaSuO3g+9Qtlk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qbl/3kOykawDVhQZFaWax3PLoO4Tfl1MUPFEBM/Ub/EWlCrSZfwy63CNYd16RmRyo e75zLi9J7Z8FyIRM0/BuonflBfIwUpKiSSWzOiZwFR2dp8HMA3gwOAE2BulirUcRD6 PKa+ILwPh0YGuGMug4avahOn3f6re1gGsqDgb+gc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mao Wenan , Greg Kroah-Hartman , Sasha Levin , devel@driverdev.osuosl.org Subject: [PATCH AUTOSEL 5.2 032/171] staging: kpc2000: report error status to spi core Date: Thu, 18 Jul 2019 23:54:23 -0400 Message-Id: <20190719035643.14300-32-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719035643.14300-1-sashal@kernel.org> References: <20190719035643.14300-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mao Wenan [ Upstream commit 9164f336311863d3e9f80840f4a1cce2aee293bd ] There is an error condition that's not reported to the spi core in kp_spi_transfer_one_message(). It should restore status value to m->status, and return it in error path. Signed-off-by: Mao Wenan Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/kpc2000/kpc_spi/spi_driver.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/staging/kpc2000/kpc_spi/spi_driver.c b/drivers/staging/kpc2000/kpc_spi/spi_driver.c index 86df16547a92..2f535022dc03 100644 --- a/drivers/staging/kpc2000/kpc_spi/spi_driver.c +++ b/drivers/staging/kpc2000/kpc_spi/spi_driver.c @@ -333,7 +333,7 @@ kp_spi_transfer_one_message(struct spi_master *master, struct spi_message *m) list_for_each_entry(transfer, &m->transfers, transfer_list) { if (transfer->tx_buf == NULL && transfer->rx_buf == NULL && transfer->len) { status = -EINVAL; - break; + goto error; } /* transfer */ @@ -371,7 +371,7 @@ kp_spi_transfer_one_message(struct spi_master *master, struct spi_message *m) if (count != transfer->len) { status = -EIO; - break; + goto error; } } @@ -389,6 +389,10 @@ kp_spi_transfer_one_message(struct spi_master *master, struct spi_message *m) /* done work */ spi_finalize_current_message(master); return 0; + + error: + m->status = status; + return status; } static void -- 2.20.1