Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1437165

[PATCH] GPIO_KEYS: If devm_add_action() fails, we are explicitly calling the cleanup to freethe resources allocated. Use the helper devm_add_action_or_reset() and return directly in case of error, since the cleanup function has been already called by the helper if there was any error.

From Arvind Yadav <arvind.yadav.cs@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] GPIO_KEYS: If devm_add_action() fails, we are explicitly calling the cleanup to freethe resources allocated. Use the helper devm_add_action_or_reset() and return directly in case of error, since the cleanup function has been already called by the helper if there was any error.
Date 2016-07-05 18:30 +0200
Message-ID <rRBou-5cR-27@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/input/keyboard/gpio_keys.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 2909365..a2fa3bb 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -542,7 +542,8 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
 	 * Install custom action to cancel release timer and
 	 * workqueue item.
 	 */
-	error = devm_add_action(&pdev->dev, gpio_keys_quiesce_key, bdata);
+	error = devm_add_action_or_reset(&pdev->dev, gpio_keys_quiesce_key,
+					bdata);
 	if (error) {
 		dev_err(&pdev->dev,
 			"failed to register quiesce action, error: %d\n",
-- 
1.9.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] GPIO_KEYS: If devm_add_action() fails, we are explicitly calling the cleanup to freethe resources allocated. Use the helper devm_add_action_or_reset() and return directly in case of error, since the cleanup function has been already called by the helper if there was any error. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2016-07-05 18:30 +0200
  Re: [PATCH] GPIO_KEYS: If devm_add_action() fails, we are explicitly  calling the cleanup to freethe resources allocated. Use the helper  devm_add_action_or_reset() and return directly in case of error, since the  cleanup function has been already called by the helper if there was any  error. Bjorn Andersson <bjorn.andersson@linaro.org> - 2016-07-05 19:10 +0200
    Re: [PATCH] GPIO_KEYS: If devm_add_action() fails, we are explicitly  calling the cleanup to freethe resources allocated. Use the helper  devm_add_action_or_reset() and return directly in case of error, since the  cleanup function has been already called by the helper if there was any  error. arvind Yadav <arvind.yadav.cs@gmail.com> - 2016-07-06 13:30 +0200
    Re: [PATCH] GPIO_KEYS: If devm_add_action() fails, we are explicitly  calling the cleanup to freethe resources allocated. Use the helper  devm_add_action_or_reset() and return directly in case of error, since the  cleanup function has been already called by the helper if there was any  error. Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-07-06 20:10 +0200

csiph-web