diff options
| author | Dave Airlie <airlied@redhat.com> | 2017-06-27 07:24:49 +1000 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2017-06-27 08:28:30 +1000 |
| commit | 6d61e70ccc21606ffb8a0a03bd3aba24f659502b (patch) | |
| tree | 69f5bfb29d085cc42839445d34170bd3ee4f7408 /drivers/input/misc | |
| parent | 338ffbf7cb5eee0ed4600650d03cd2d7cd1cac9d (diff) | |
| parent | c0bc126f97fb929b3ae02c1c62322645d70eb408 (diff) | |
Backmerge tag 'v4.12-rc7' into drm-next
Linux 4.12-rc7
Needed at least rc6 for drm-misc-next-fixes, may as well go to rc7
Diffstat (limited to 'drivers/input/misc')
| -rw-r--r-- | drivers/input/misc/soc_button_array.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c index e37d37273182..f600f3a7a3c6 100644 --- a/drivers/input/misc/soc_button_array.c +++ b/drivers/input/misc/soc_button_array.c @@ -248,7 +248,8 @@ static struct soc_button_info *soc_button_get_button_info(struct device *dev) if (!btns_desc) { dev_err(dev, "ACPI Button Descriptors not found\n"); - return ERR_PTR(-ENODEV); + button_info = ERR_PTR(-ENODEV); + goto out; } /* The first package describes the collection */ @@ -264,24 +265,31 @@ static struct soc_button_info *soc_button_get_button_info(struct device *dev) } if (collection_uid == -1) { dev_err(dev, "Invalid Button Collection Descriptor\n"); - return ERR_PTR(-ENODEV); + button_info = ERR_PTR(-ENODEV); + goto out; } /* There are package.count - 1 buttons + 1 terminating empty entry */ button_info = devm_kcalloc(dev, btns_desc->package.count, sizeof(*button_info), GFP_KERNEL); - if (!button_info) - return ERR_PTR(-ENOMEM); + if (!button_info) { + button_info = ERR_PTR(-ENOMEM); + goto out; + } /* Parse the button descriptors */ for (i = 1, btn = 0; i < btns_desc->package.count; i++, btn++) { if (soc_button_parse_btn_desc(dev, &btns_desc->package.elements[i], collection_uid, - &button_info[btn])) - return ERR_PTR(-ENODEV); + &button_info[btn])) { + button_info = ERR_PTR(-ENODEV); + goto out; + } } +out: + kfree(buf.pointer); return button_info; } |
