[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1458084692-23100-55-git-send-email-kamal@canonical.com>
Date: Tue, 15 Mar 2016 16:30:48 -0700
From: Kamal Mostafa <kamal@...onical.com>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
kernel-team@...ts.ubuntu.com
Cc: Wolfram Sang <wsa@...-dreams.de>,
Kamal Mostafa <kamal@...onical.com>
Subject: [PATCH 4.2.y-ckt 54/98] i2c: brcmstb: allocate correct amount of memory for regmap
4.2.8-ckt6 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Wolfram Sang <wsa@...-dreams.de>
commit 7314d22a2f5bd40468d57768be368c3d9b4bd726 upstream.
We want the size of the struct, not of a pointer to it. To be future
proof, just dereference the pointer to get the desired type.
Fixes: dd1aa2524bc5 ("i2c: brcmstb: Add Broadcom settop SoC i2c controller driver")
Acked-by: Gregory Fong <gregory.0xf0@...il.com>
Acked-by: Florian Fainelli <f.fainelli@...il.com>
Reviewed-by: Kamal Dasu <kdasu.kdev@...il.com>
Signed-off-by: Wolfram Sang <wsa@...-dreams.de>
Signed-off-by: Kamal Mostafa <kamal@...onical.com>
---
drivers/i2c/busses/i2c-brcmstb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
index 8e9637e..81115ab 100644
--- a/drivers/i2c/busses/i2c-brcmstb.c
+++ b/drivers/i2c/busses/i2c-brcmstb.c
@@ -562,8 +562,7 @@ static int brcmstb_i2c_probe(struct platform_device *pdev)
if (!dev)
return -ENOMEM;
- dev->bsc_regmap = devm_kzalloc(&pdev->dev, sizeof(struct bsc_regs *),
- GFP_KERNEL);
+ dev->bsc_regmap = devm_kzalloc(&pdev->dev, sizeof(*dev->bsc_regmap), GFP_KERNEL);
if (!dev->bsc_regmap)
return -ENOMEM;
--
2.7.0
Powered by blists - more mailing lists