[Skiboot] [PATCH] pnor_init() - Fix Uninitialized pointer read
Kamalesh Babulal
kamalesh at linux.vnet.ibm.com
Fri Jul 3 18:22:46 AEST 2015
In pnor_init(), there are chances of pointer bl being read before
assignment. Fix it by initializing it to NULL.
Fixes Coverity defect#97868.
Signed-off-by: Kamalesh Babulal <kamalesh at linux.vnet.ibm.com>
Cc: Cyril Bur <cyril.bur at au1.ibm.com>
---
platforms/astbmc/pnor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/platforms/astbmc/pnor.c b/platforms/astbmc/pnor.c
index 634cb86..2cd57c6 100644
--- a/platforms/astbmc/pnor.c
+++ b/platforms/astbmc/pnor.c
@@ -28,7 +28,7 @@
int pnor_init(void)
{
struct spi_flash_ctrl *pnor_ctrl;
- struct blocklevel_device *bl;
+ struct blocklevel_device *bl = NULL;
int rc;
/* Open controller and flash. If the LPC->AHB doesn't point to
--
2.1.2
More information about the Skiboot
mailing list