]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
arm: mvebu: avoid possible NULL dereference
authorxypron.glpk@gmx.de <xypron.glpk@gmx.de>
Sun, 30 Jul 2017 18:40:43 +0000 (20:40 +0200)
committerTom Rini <trini@konsulko.com>
Sun, 13 Aug 2017 19:17:28 +0000 (15:17 -0400)
It does not make sense to check if info is NULL after
dereferencing it.

The problem was indicated by cppcheck.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c

index b0e193b78c0d08a3af43a806cf5ee5dd877eca53..525576a4fc8a9173ed65cf1a4d63eb6717a7c6c5 100644 (file)
@@ -354,16 +354,16 @@ int serdes_phy_config(void)
        }
 
        info = board_serdes_cfg_get(PEX_MODE_GET(satr11));
-       DEBUG_INIT_FULL_S("info->line0_7= 0x");
-       DEBUG_INIT_FULL_D(info->line0_7, 8);
-       DEBUG_INIT_FULL_S("   info->line8_15= 0x");
-       DEBUG_INIT_FULL_D(info->line8_15, 8);
-       DEBUG_INIT_FULL_S("\n");
 
        if (info == NULL) {
                DEBUG_INIT_S("Hight speed PHY Error #1\n");
                return MV_ERROR;
        }
+       DEBUG_INIT_FULL_S("info->line0_7= 0x");
+       DEBUG_INIT_FULL_D(info->line0_7, 8);
+       DEBUG_INIT_FULL_S("   info->line8_15= 0x");
+       DEBUG_INIT_FULL_D(info->line8_15, 8);
+       DEBUG_INIT_FULL_S("\n");
 
        if (config_module & ETM_MODULE_DETECT) {        /* step 0.9 ETM */
                DEBUG_INIT_FULL_S("ETM module detect Step 0.9:\n");