Skip to content

Commit

Permalink
pinctrl: samsung: Handle memory allocation failure during wakeup bank…
Browse files Browse the repository at this point in the history
…s init

Check if kmemdup failed during wakeup banks initialization.  Otherwise
NULL pointer would be stored under "irq_chip" member of bank and later
dereferenced in interrupt handler.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
  • Loading branch information
Krzysztof Kozlowski committed Jun 7, 2017
1 parent 71b96c3 commit a1ea9a4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/pinctrl/samsung/pinctrl-exynos.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,8 @@ int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d)
if (match) {
irq_chip = kmemdup(match->data,
sizeof(*irq_chip), GFP_KERNEL);
if (!irq_chip)
return -ENOMEM;
wkup_np = np;
break;
}
Expand Down

0 comments on commit a1ea9a4

Please sign in to comment.