All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvmem: core: don't check the return value of notifier chain call
@ 2019-02-15 10:42 Bartosz Golaszewski
  2019-02-15 10:44 ` Srinivas Kandagatla
  0 siblings, 1 reply; 2+ messages in thread
From: Bartosz Golaszewski @ 2019-02-15 10:42 UTC (permalink / raw)
  To: Srinivas Kandagatla, Greg Kroah-Hartman
  Cc: linux-kernel, Bartosz Golaszewski, stable

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

blocking_notifier_call_chain() returns the value returned by the last
registered callback. A positive return value doesn't indicate an error
and an nvmem device should correctly register irrespective of any
notifier callback failures. Drop the retval check.

Fixes: bee1138bea15 ("nvmem: add a notifier chain")
Cc: stable@vger.kernel.org
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/nvmem/core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index f7301bb4ef3b..3ce65927e11c 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -686,9 +686,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config)
 	if (rval)
 		goto err_remove_cells;
 
-	rval = blocking_notifier_call_chain(&nvmem_notifier, NVMEM_ADD, nvmem);
-	if (rval)
-		goto err_remove_cells;
+	blocking_notifier_call_chain(&nvmem_notifier, NVMEM_ADD, nvmem);
 
 	return nvmem;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] nvmem: core: don't check the return value of notifier chain call
  2019-02-15 10:42 [PATCH] nvmem: core: don't check the return value of notifier chain call Bartosz Golaszewski
@ 2019-02-15 10:44 ` Srinivas Kandagatla
  0 siblings, 0 replies; 2+ messages in thread
From: Srinivas Kandagatla @ 2019-02-15 10:44 UTC (permalink / raw)
  To: Bartosz Golaszewski, Greg Kroah-Hartman
  Cc: linux-kernel, Bartosz Golaszewski, stable



On 15/02/2019 10:42, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> blocking_notifier_call_chain() returns the value returned by the last
> registered callback. A positive return value doesn't indicate an error
> and an nvmem device should correctly register irrespective of any
> notifier callback failures. Drop the retval check.
> 
> Fixes: bee1138bea15 ("nvmem: add a notifier chain")
> Cc: stable@vger.kernel.org
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Thanks for the fix!

Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

> ---
>   drivers/nvmem/core.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
> index f7301bb4ef3b..3ce65927e11c 100644
> --- a/drivers/nvmem/core.c
> +++ b/drivers/nvmem/core.c
> @@ -686,9 +686,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config)
>   	if (rval)
>   		goto err_remove_cells;
>   
> -	rval = blocking_notifier_call_chain(&nvmem_notifier, NVMEM_ADD, nvmem);
> -	if (rval)
> -		goto err_remove_cells;
> +	blocking_notifier_call_chain(&nvmem_notifier, NVMEM_ADD, nvmem);
>   
>   	return nvmem;
>   
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-15 10:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-15 10:42 [PATCH] nvmem: core: don't check the return value of notifier chain call Bartosz Golaszewski
2019-02-15 10:44 ` Srinivas Kandagatla

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.