clk: Fix clk_core_get NULL dereference
[linux-2.6-microblaze.git] / drivers / clk / clk.c
index 2253c15..20c4b28 100644 (file)
@@ -418,6 +418,9 @@ static struct clk_core *clk_core_get(struct clk_core *core, u8 p_index)
        if (IS_ERR(hw))
                return ERR_CAST(hw);
 
+       if (!hw)
+               return NULL;
+
        return hw->core;
 }