summaryrefslogtreecommitdiff
path: root/drivers/clk/bcm
diff options
context:
space:
mode:
authorVaishali Thakkar <vaishali.thakkar@oracle.com>2016-04-28 16:50:33 +0300
committerStephen Boyd <sboyd@codeaurora.org>2016-05-06 21:06:44 +0300
commit4087a5f2e5e75a6d0231d1318bada1a12972a5fd (patch)
treeee8d094705483e5fcd5b1af27ca4f7f847a696b3 /drivers/clk/bcm
parent2a0974aa1a0b40a92387ea03dbfeacfbc9ba182c (diff)
downloadlinux-4087a5f2e5e75a6d0231d1318bada1a12972a5fd.tar.xz
clk: bcm/kona: Do not use sizeof on pointer type
When sizeof is applied to a pointer typed expression, it gives the size of the pointer. So, here do not use sizeof on pointer type. Also, silent checkpatch.pl by using kmalloc_array over kmalloc. Note that this has no effect on runtime because 'parent_names' is a pointer to a pointer. Problem found using Coccinelle. Signed-off-by: Vaishali Thakkar <vaishali.thakkar@oracle.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/bcm')
-rw-r--r--drivers/clk/bcm/clk-kona-setup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/clk/bcm/clk-kona-setup.c b/drivers/clk/bcm/clk-kona-setup.c
index deaa7f962b84..526b0b0e9a9f 100644
--- a/drivers/clk/bcm/clk-kona-setup.c
+++ b/drivers/clk/bcm/clk-kona-setup.c
@@ -577,7 +577,8 @@ static u32 *parent_process(const char *clocks[],
* selector is not required, but we allocate space for the
* array anyway to keep things simple.
*/
- parent_names = kmalloc(parent_count * sizeof(parent_names), GFP_KERNEL);
+ parent_names = kmalloc_array(parent_count, sizeof(*parent_names),
+ GFP_KERNEL);
if (!parent_names) {
pr_err("%s: error allocating %u parent names\n", __func__,
parent_count);