History

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

Olof Johansson committed 7 years ago

Commit 2ec472e2 parents 431a8b7 21face61 file · +6 −2Browse files

Unified · Split

arch/arm/mach-integrator/impd1.c+6−2
@@ -390,10 +390,14 @@ static int __ref impd1_probe(struct lm_device *dev) · 389 unmodified lines
390390 char *mmciname;
391391
392392 lookup = devm_kzalloc(&dev->dev,
393− sizeof(*lookup) + 3 * sizeof(struct gpiod_lookup),
393+ struct_size(lookup, table, 3),
394394 GFP_KERNEL);
395395 chipname = devm_kstrdup(&dev->dev, devname, GFP_KERNEL);
396− mmciname = kasprintf(GFP_KERNEL, "lm%x:00700", dev->id);
396+ mmciname = devm_kasprintf(&dev->dev, GFP_KERNEL,
397+ "lm%x:00700", dev->id);
398+ if (!lookup || !chipname || !mmciname)
399+ return -ENOMEM;
400+
397401 lookup->dev_id = mmciname;
398402 /*
399403 * Offsets on GPIO block 1:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t