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

From: Philipp Hahn

Date: Tue Mar 10 2026 - 08:40:02 EST


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

Change generated with coccinelle.

To: Kees Cook <kees@xxxxxxxxxx>
To: Tony Luck <tony.luck@xxxxxxxxx>
To: "Guilherme G. Piccoli" <gpiccoli@xxxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
Signed-off-by: Philipp Hahn <phahn-oss@xxxxxx>
---
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