aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/musb/cppi_dma.c
diff options
context:
space:
mode:
authorManu Gautam <mgautam@codeaurora.org>2017-02-24 15:22:40 +0530
committerMoyster <oysterized@gmail.com>2018-11-27 16:09:55 +0100
commit513cef2c53c2b3846f6c571823412f514b6f66c7 (patch)
tree91c79e2c53b67916729fbfea3150bf7d9571bbdc /drivers/usb/musb/cppi_dma.c
parentb32e2d51665e3b6af648dec474db214b6312d967 (diff)
downloadandroid_kernel_m2note-513cef2c53c2b3846f6c571823412f514b6f66c7.tar.gz
usb: replace %p with %pK
Format specifier %p can leak kernel addresses while not valuing the kptr_restrict system settings. When kptr_restrict is set to (1), kernel pointers printed using the %pK format specifier will be replaced with 0's. Debugging Note : &pK prints only Zeros as address. If you need actual address information, write 0 to kptr_restrict. echo 0 > /proc/sys/kernel/kptr_restrict CRs-fixed: 1052849 Change-Id: I0e98145730380ea983fa8f46a28d15dd6c2c31df Signed-off-by: Manu Gautam <mgautam@codeaurora.org> Signed-off-by: Yasir Malik <ymalik@codeaurora.org> Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
Diffstat (limited to 'drivers/usb/musb/cppi_dma.c')
-rw-r--r--drivers/usb/musb/cppi_dma.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/usb/musb/cppi_dma.c b/drivers/usb/musb/cppi_dma.c
index 9db211ee1..8a749b4e9 100644
--- a/drivers/usb/musb/cppi_dma.c
+++ b/drivers/usb/musb/cppi_dma.c
@@ -323,7 +323,7 @@ cppi_channel_allocate(struct dma_controller *c,
* with the other DMA engine too
*/
if (cppi_ch->hw_ep)
- dev_dbg(musb->controller, "re-allocating DMA%d %cX channel %p\n",
+ dev_dbg(musb->controller, "re-allocating DMA%d %cX channel %pK\n",
index, transmit ? 'T' : 'R', cppi_ch);
cppi_ch->hw_ep = ep;
cppi_ch->channel.status = MUSB_DMA_STATUS_FREE;
@@ -345,7 +345,7 @@ static void cppi_channel_release(struct dma_channel *channel)
tibase = c->controller->tibase;
if (!c->hw_ep)
dev_dbg(c->controller->musb->controller,
- "releasing idle DMA channel %p\n", c);
+ "releasing idle DMA channel %pK\n", c);
else if (!c->transmit)
core_rxirq_enable(tibase, c->index + 1);
@@ -656,7 +656,7 @@ cppi_next_tx_segment(struct musb *musb, struct cppi_channel *tx)
bd->hw_options |= CPPI_ZERO_SET;
}
- dev_dbg(musb->controller, "TXBD %p: nxt %08x buf %08x len %04x opt %08x\n",
+ dev_dbg(musb->controller, "TXBD %pK: nxt %08x buf %08x len %04x opt %08x\n",
bd, bd->hw_next, bd->hw_bufp,
bd->hw_off_len, bd->hw_options);
@@ -1110,7 +1110,7 @@ static bool cppi_rx_scan(struct cppi *cppi, unsigned ch)
musb_ep_select(cppi->mregs, rx->index + 1);
csr = musb_readw(regs, MUSB_RXCSR);
if (csr & MUSB_RXCSR_DMAENAB) {
- dev_dbg(musb->controller, "list%d %p/%p, last %llx%s, csr %04x\n",
+ dev_dbg(musb->controller, "list%d %pK/%pK, last %llx%s, csr %04x\n",
rx->index,
rx->head, rx->tail,
rx->last_processed
@@ -1216,7 +1216,7 @@ irqreturn_t cppi_interrupt(int irq, void *dev_id)
if (bd->hw_options & CPPI_OWN_SET)
break;
- dev_dbg(musb->controller, "C/TXBD %p n %x b %x off %x opt %x\n",
+ dev_dbg(musb->controller, "C/TXBD %pK n %x b %x off %x opt %x\n",
bd, bd->hw_next, bd->hw_bufp,
bd->hw_off_len, bd->hw_options);