提交 2ec472ed 编写于 作者: O Olof Johansson

Merge tag 'integrator-fixes-armsoc' of...

Merge tag 'integrator-fixes-armsoc' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator into fixes

Fixes for the Integrator:
- Handle failed allocations in the IM/PC bus attachment.
- Use struct_size() for allocation.

* tag 'integrator-fixes-armsoc' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator:
  ARM: integrator: impd1: use struct_size() in devm_kzalloc()
  gpio: pl061: handle failed allocations
Signed-off-by: NOlof Johansson <olof@lixom.net>
...@@ -390,10 +390,14 @@ static int __ref impd1_probe(struct lm_device *dev) ...@@ -390,10 +390,14 @@ static int __ref impd1_probe(struct lm_device *dev)
char *mmciname; char *mmciname;
lookup = devm_kzalloc(&dev->dev, lookup = devm_kzalloc(&dev->dev,
sizeof(*lookup) + 3 * sizeof(struct gpiod_lookup), struct_size(lookup, table, 3),
GFP_KERNEL); GFP_KERNEL);
chipname = devm_kstrdup(&dev->dev, devname, GFP_KERNEL); chipname = devm_kstrdup(&dev->dev, devname, GFP_KERNEL);
mmciname = kasprintf(GFP_KERNEL, "lm%x:00700", dev->id); mmciname = devm_kasprintf(&dev->dev, GFP_KERNEL,
"lm%x:00700", dev->id);
if (!lookup || !chipname || !mmciname)
return -ENOMEM;
lookup->dev_id = mmciname; lookup->dev_id = mmciname;
/* /*
* Offsets on GPIO block 1: * Offsets on GPIO block 1:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册