]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
clk: davinci: Use the correct size when allocating memory
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 9 Aug 2020 14:49:59 +0000 (16:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Sep 2020 10:59:52 +0000 (12:59 +0200)
[ Upstream commit 3dabfa2bda48dab717986609762ce2a49335eb99 ]

'sizeof(*pllen)' should be used in place of 'sizeof(*pllout)' to avoid a
small over-allocation.

Fixes: 2d1726915159 ("clk: davinci: New driver for davinci PLL clocks")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/20200809144959.747986-1-christophe.jaillet@wanadoo.fr
Reviewed-by: David Lechner <david@lechnology.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/davinci/pll.c

index 8a23d5dfd1f8dbb6d6984c03e7d2e3f433a354c4..5f063e1be4b143b434f0885d7a4584c9f20ef09c 100644 (file)
@@ -491,7 +491,7 @@ struct clk *davinci_pll_clk_register(struct device *dev,
                parent_name = postdiv_name;
        }
 
-       pllen = kzalloc(sizeof(*pllout), GFP_KERNEL);
+       pllen = kzalloc(sizeof(*pllen), GFP_KERNEL);
        if (!pllen) {
                ret = -ENOMEM;
                goto err_unregister_postdiv;