[PATCH 11/61] pstore: Prefer IS_ERR_OR_NULL over manual NULL check

Philipp Hahn phahn-oss at avm.de
Tue Mar 10 04:48:37 PDT 2026


Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
check.

Change generated with coccinelle.

To: Kees Cook <kees at kernel.org>
To: Tony Luck <tony.luck at intel.com>
To: "Guilherme G. Piccoli" <gpiccoli at igalia.com>
Cc: linux-kernel at vger.kernel.org
Signed-off-by: Philipp Hahn <phahn-oss at avm.de>
---
 fs/pstore/zone.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/pstore/zone.c b/fs/pstore/zone.c
index a3b003f9a3a079c482b673f57023ce88fc290dbf..dce8403ca18566cc4a7a853ccdc7e1c165666fcb 100644
--- a/fs/pstore/zone.c
+++ b/fs/pstore/zone.c
@@ -1226,7 +1226,7 @@ static struct pstore_zone **psz_init_zones(enum pstore_type_id type,
 
 	for (i = 0; i < c; i++) {
 		zone = psz_init_zone(type, off, record_size);
-		if (!zone || IS_ERR(zone)) {
+		if (IS_ERR_OR_NULL(zone)) {
 			pr_err("initialize zones %s failed\n", name);
 			psz_free_zones(&zones, &i);
 			return (void *)zone;

-- 
2.43.0




More information about the Linux-rockchip mailing list