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>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 27 Jan 2017 16:55:59 +0530
From:   Shailendra Verma <shailendra.v@...sung.com>
To:     Dan Williams <dan.j.williams@...el.com>,
        Vinod Koul <vinod.koul@...el.com>, dmaengine@...r.kernel.org,
        linux-kernel@...r.kernel.org, p.shailesh@...sung.com,
        ashish.kalra@...sung.com,
        Shailendra Verma <shailendra.v@...sung.com>,
        Shailendra Verma <shailendra.capricorn@...il.com>
Subject: [PATCH] Dma - Fix possible NULL derefrence.

of_match_device could return NULL, and so cause a NULL
pointer dereference later.

Signed-off-by: Shailendra Verma <shailendra.v@...sung.com>
---
 drivers/dma/mv_xor.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index 23f7528..c25b3bb 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -1323,7 +1323,10 @@ static int mv_xor_probe(struct platform_device *pdev)
 		const struct of_device_id *of_id =
 			of_match_device(mv_xor_dt_ids,
 					&pdev->dev);
+		if (!of_id) {
+			dev_err(&pdev->dev, "Error: No device match found\n");
+			return -ENODEV;
+		}
 		xordev->xor_type = (uintptr_t)of_id->data;
 	}
 
-- 
1.7.9.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ