lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <87sizx1ygm.wl%kuninori.morimoto.gx@renesas.com>
Date:	Mon, 01 Jul 2013 19:34:53 -0700 (PDT)
From:	Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
To:	Vinod Koul <vinod.koul@...ux.intel.com>
Cc:	Guennadi Liakhovetski <g.liakhovetski@....de>,
	linux-kernel@...r.kernel.org
Subject: [PATCH] shdma: fixup sh_dmae_get_partial() calculation error

sh_desc->hw.tcr is controlling data size,
and register TCR is controlling data transfer count
which was xmit_shift'ed value of hw.tcr.
Current sh_dmae_get_partial() is calculating in different unit.
This patch fixes it.

Cc: Guennadi Liakhovetski <g.liakhovetski@....de>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
---
>> Guennadi

Can you please review this patch ?

 drivers/dma/sh/shdma.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/sh/shdma.c b/drivers/dma/sh/shdma.c
index b70709b..d670b8b 100644
--- a/drivers/dma/sh/shdma.c
+++ b/drivers/dma/sh/shdma.c
@@ -388,8 +388,8 @@ static size_t sh_dmae_get_partial(struct shdma_chan *schan,
 						    shdma_chan);
 	struct sh_dmae_desc *sh_desc = container_of(sdesc,
 					struct sh_dmae_desc, shdma_desc);
-	return (sh_desc->hw.tcr - sh_dmae_readl(sh_chan, TCR)) <<
-		sh_chan->xmit_shift;
+	return sh_desc->hw.tcr -
+		(sh_dmae_readl(sh_chan, TCR) << sh_chan->xmit_shift);
 }
 
 /* Called from error IRQ or NMI */
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ