Return-Path: Received: from mga02.intel.com ([134.134.136.20]:31359 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754126AbdEQP3o (ORCPT ); Wed, 17 May 2017 11:29:44 -0400 From: Mathias Nyman To: Cc: , Peter Chen , stable , Mathias Nyman Subject: [PATCH 3/8] usb: host: xhci-mem: allocate zeroed Scratchpad Buffer Date: Wed, 17 May 2017 18:32:01 +0300 Message-Id: <1495035126-29091-4-git-send-email-mathias.nyman@linux.intel.com> In-Reply-To: <1495035126-29091-1-git-send-email-mathias.nyman@linux.intel.com> References: <1495035126-29091-1-git-send-email-mathias.nyman@linux.intel.com> Sender: stable-owner@vger.kernel.org List-ID: From: Peter Chen According to xHCI ch4.20 Scratchpad Buffers, the Scratchpad Buffer needs to be zeroed. ... The following operations take place to allocate Scratchpad Buffers to the xHC: ... b. Software clears the Scratchpad Buffer to '0' Cc: stable Signed-off-by: Peter Chen Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 69428e9..12b573c 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -1724,7 +1724,7 @@ static int scratchpad_alloc(struct xhci_hcd *xhci, gfp_t flags) xhci->dcbaa->dev_context_ptrs[0] = cpu_to_le64(xhci->scratchpad->sp_dma); for (i = 0; i < num_sp; i++) { dma_addr_t dma; - void *buf = dma_alloc_coherent(dev, xhci->page_size, &dma, + void *buf = dma_zalloc_coherent(dev, xhci->page_size, &dma, flags); if (!buf) goto fail_sp4; -- 1.9.1