lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190214162349.22740-1-brgl@bgdev.pl>
Date:   Thu, 14 Feb 2019 17:23:49 +0100
From:   Bartosz Golaszewski <brgl@...ev.pl>
To:     Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        stable@...r.kernel.org
Subject: [PATCH] nvmem: core: fix the return value check when calling the notifier chain

From: Bartosz Golaszewski <bgolaszewski@...libre.com>

blocking_notifier_call_chain() returns the value returned by the last
registered callback. A positive return value doesn't indicate an error
so check only if it's negative.

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ