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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1419458210-4079-1-git-send-email-m-karicheri2@ti.com>
Date:	Wed, 24 Dec 2014 16:56:50 -0500
From:	Murali Karicheri <m-karicheri2@...com>
To:	<linux@....linux.org.uk>, <linux-arm-kernel@...ts.infradead.org>,
	<linux-kernel@...r.kernel.org>, <arnd@...db.de>,
	<will.deacon@....com>, <grant.likely@...aro.org>,
	<robh+dt@...nel.org>, <devicetree@...r.kernel.org>
CC:	Murali Karicheri <m-karicheri2@...com>
Subject: [PATCH] dma-mapping: fix size when of_dma_get_range() fails

When call to of_dma_get_range() fails, the code currently set size
to dev->coherent_dma_mask instead of dev->coherent_dma_mask + 1. Fix this
to make the code consistent with the case when size is obtained from
dma-range property.

Signed-off-by: Murali Karicheri <m-karicheri2@...com>
Reviewed-by: Arnd Bergmann <arnd@...db.de>
---
 drivers/of/platform.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index a54ec10..af9aef1 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -185,7 +185,7 @@ static void of_dma_configure(struct device *dev)
 	ret = of_dma_get_range(dev->of_node, &dma_addr, &paddr, &size);
 	if (ret < 0) {
 		dma_addr = offset = 0;
-		size = dev->coherent_dma_mask;
+		size = dev->coherent_dma_mask + 1;
 	} else {
 		offset = PFN_DOWN(paddr - dma_addr);
 		dev_dbg(dev, "dma_pfn_offset(%#08lx)\n", offset);
-- 
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