aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorDevendra Naga <devendra.aaru@gmail.com>2014-11-29 17:48:34 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-12-02 16:45:24 -0800
commit5f18611038f9c9d503318490069b730c942523f8 (patch)
tree1808c89ed4acb0a157774adde6a453c7b4156ddb /drivers/staging
parent315f9a2fe237c81535695005592eb7c586f3181e (diff)
staging: clocking-wizard: check for a valid clk_name pointer
The clk_name gets the return value from kasprintf (part of which does the allocation of the returned buffer). So check the return pointer before using it for clk_register_fixed_factor. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Reviewed-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
index 7202d8e889aa..0a3a8fe67fb5 100644
--- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
+++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
@@ -221,6 +221,11 @@ static int clk_wzrd_probe(struct platform_device *pdev)
reg = (readl(clk_wzrd->base + WZRD_CLK_CFG_REG(0)) &
WZRD_DIVCLK_DIVIDE_MASK) >> WZRD_DIVCLK_DIVIDE_SHIFT;
clk_name = kasprintf(GFP_KERNEL, "%s_mul_div", dev_name(&pdev->dev));
+ if (!clk_name) {
+ ret = -ENOMEM;
+ goto err_rm_int_clk;
+ }
+
clk_wzrd->clks_internal[wzrd_clk_mul_div] = clk_register_fixed_factor(
&pdev->dev, clk_name,
__clk_get_name(clk_wzrd->clks_internal[wzrd_clk_mul]),

Privacy Policy