Skip to content

Commit

Permalink
i2c: brcmstb: allocate correct amount of memory for regmap
Browse files Browse the repository at this point in the history
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: dd1aa25 ("i2c: brcmstb: Add Broadcom settop SoC i2c controller driver")
Acked-by: Gregory Fong <gregory.0xf0@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Kamal Dasu <kdasu.kdev@gmail.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
  • Loading branch information
Wolfram Sang committed Mar 1, 2016
1 parent fc77dbd commit 7314d22
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/i2c/busses/i2c-brcmstb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 7314d22

Please sign in to comment.