Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3798908ybi; Mon, 29 Jul 2019 12:51:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJFBtYwj0TMCO2m2YFvWSMyZyIjf1B9jRPdTgzLw5rPw7m9AD1eB2qiS2Y6t3PjeZz7eXT X-Received: by 2002:a17:902:8649:: with SMTP id y9mr109826170plt.289.1564429879494; Mon, 29 Jul 2019 12:51:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429879; cv=none; d=google.com; s=arc-20160816; b=CUPNa8AG6ufSWk/Ke7+pUm298KHxQyaXxfBMnVLQIUDW/RcousQvbiGfH0gbXMW4zZ VbymnRbWqo47R25SC4XCeCnzcPgJmdpzXmu00uvnGsFHlt0gqOCr6koLmpntn21wKAKv bXu7OzUmowY8snzIARg4tZf3FIgBlRW2K/t6tReryF4XRtBk3EmTgo1P1bEixOp0laUR XDo1cHfrLi2Q6Ns4xjUo0yxsC+OiJPmSHywO/ciDm8seKgL4YbJhdAL4/We4V5uK30DS jGD/DFiw197qDyDNcEUVvJQnVbUWmr6dcBaEizW2YWlNrfMhX89BAs5xtYy8JIRi0lj0 AdNA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DFB+1uJzKRbr8TVFIR29Ji0L4W2eHjFbTk64vF6MUDU=; b=grrdhkTKKD0J7HId5C/r9/2IscF80hWI4Ql/MmmdWxPhy7mTm/RvTN2+ium8p1kFEV L8RBL7wlWnRsKMxwDCW47PeT+6IV8uBgjSjGZ8/1CE+pcdWf99sl5UyB+VM+Fh8wJ3P9 kCFA+0YZk0QTaPNQHTGrCUtn54r+xf5FxG4sa49t3lQD4zgYO+XLVfYump4k16DBFnZZ eLshmn0MXviHyw5jZYQygN+cgmHQEVE3ftw41x9UEkOoEYZnYBmicXZRN6i7epjqdvXt u7sz/zICnCv9e4lgyMdzGDAXPGKn3sNumuYlx57duNHkG3uFDnAAhUXoDswso3CJF9bA GMxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="hurK1f/U"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b35si27003407plb.249.2019.07.29.12.51.04; Mon, 29 Jul 2019 12:51:19 -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="hurK1f/U"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390172AbfG2Tsg (ORCPT + 99 others); Mon, 29 Jul 2019 15:48:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:38834 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390142AbfG2Tse (ORCPT ); Mon, 29 Jul 2019 15:48:34 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 63052205F4; Mon, 29 Jul 2019 19:48:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429713; bh=swzzTSWVDkECQUft7G79O2Qg7RSN7yfYSx8KiYioYDo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hurK1f/UPT6JlWb5KcHrNCoBnn2ChOGMOLHA/UNN3ZPpH9T9/P91xL1WCN3fJ5cDH +9CC2tbPyez1mve3lg8ZvlmmFw6nze2KQAx0NTXJfeFnJxtGD9ysb1+FOYUNnK2Fqa 8dpSeTO8kc5hS16HJgW9Gb98VJjE5QfOfxKi7BOM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mao Wenan , Sasha Levin Subject: [PATCH 5.2 034/215] staging: kpc2000: report error status to spi core Date: Mon, 29 Jul 2019 21:20:30 +0200 Message-Id: <20190729190746.218831662@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ 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