Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964975AbbLGPTl (ORCPT ); Mon, 7 Dec 2015 10:19:41 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:32801 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933038AbbLGPGl (ORCPT ); Mon, 7 Dec 2015 10:06:41 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Ricard , Samuel Ortiz Subject: [PATCH 4.3 057/125] NFC: st-nci: Fix incorrect spi buffer size Date: Mon, 7 Dec 2015 10:01:10 -0500 Message-Id: <20151207145755.082203694@linuxfoundation.org> X-Mailer: git-send-email 2.6.3 In-Reply-To: <20151207145752.225938417@linuxfoundation.org> References: <20151207145752.225938417@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1540 Lines: 47 4.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christophe Ricard commit a1269dd116319335db6d73013a31c038486c813e upstream. When sending data over SPI, the maximum expected length is the maximum nci packet payload + data header size + the frame head room (1 for the ndlc header) + the frame trail room (0). Signed-off-by: Christophe Ricard Signed-off-by: Samuel Ortiz Signed-off-by: Greg Kroah-Hartman --- drivers/nfc/st-nci/spi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/nfc/st-nci/spi.c +++ b/drivers/nfc/st-nci/spi.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include "ndlc.h" @@ -94,7 +95,8 @@ static int st_nci_spi_write(void *phy_id struct st_nci_spi_phy *phy = phy_id; struct spi_device *dev = phy->spi_dev; struct sk_buff *skb_rx; - u8 buf[ST_NCI_SPI_MAX_SIZE]; + u8 buf[ST_NCI_SPI_MAX_SIZE + NCI_DATA_HDR_SIZE + + ST_NCI_FRAME_HEADROOM + ST_NCI_FRAME_TAILROOM]; struct spi_transfer spi_xfer = { .tx_buf = skb->data, .rx_buf = buf, -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/