linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: brcmstb: allocate correct amount of memory for regmap
@ 2016-02-21 14:16 Wolfram Sang
  2016-02-22  6:33 ` Gregory Fong
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Wolfram Sang @ 2016-02-21 14:16 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
 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 3711df1d452622..4a45408dd82060 100644
--- a/drivers/i2c/busses/i2c-brcmstb.c
+++ b/drivers/i2c/busses/i2c-brcmstb.c
@@ -586,8 +586,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

^ permalink raw reply related	[flat|nested] 8+ messages in thread
[parent not found: <CAC=U0a0FR8u3=zYU7xDW4dJxbwFUY4RHxMdK9zoEHdXcWyNDPg@mail.gmail.com>]

end of thread, other threads:[~2016-03-01 18:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-21 14:16 [PATCH] i2c: brcmstb: allocate correct amount of memory for regmap Wolfram Sang
2016-02-22  6:33 ` Gregory Fong
2016-02-22  8:05   ` Wolfram Sang
2016-02-22 16:42 ` Florian Fainelli
2016-02-25 20:08   ` Kamal Dasu
2016-03-01 18:19 ` Wolfram Sang
     [not found] <CAC=U0a0FR8u3=zYU7xDW4dJxbwFUY4RHxMdK9zoEHdXcWyNDPg@mail.gmail.com>
2016-03-01 16:14 ` Kamal Dasu
2016-03-01 16:19   ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).