[PATCH] leon,ambapp: fixes bad allocation check

Daniel Hellstrom daniel at gaisler.com
Fri Aug 25 11:51:24 UTC 2017


Updates #2496 but to close needs to be applied to 4.11 accoring to ticket.
---
 c/src/lib/libbsp/sparc/shared/amba/ambapp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/c/src/lib/libbsp/sparc/shared/amba/ambapp.c b/c/src/lib/libbsp/sparc/shared/amba/ambapp.c
index e4f1aac..e3c777a 100644
--- a/c/src/lib/libbsp/sparc/shared/amba/ambapp.c
+++ b/c/src/lib/libbsp/sparc/shared/amba/ambapp.c
@@ -254,7 +254,7 @@ static int ambapp_scan2(
           continue;
 
         apbdev = ambapp_alloc_dev_struct(DEV_APB_SLV);
-        if (!dev)
+        if (!apbdev)
           return -1;
 
         ambapp_apb_dev_init(apbbase, abus->mmaps,
-- 
2.7.4




More information about the devel mailing list