[PATCH 11/61] pstore: Prefer IS_ERR_OR_NULL over manual NULL check
Philipp Hahn <[email protected]>
| Newsgroups | gmane.linux.ports.sh.devel |
|---|---|
| Message-ID | <20260310-b4-is_err_or_null-v1-11-bd63b656022d__39777.3655409523$1773144569$gmane$org@avm.de> |
Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL check. Change generated with coccinelle. To: Kees Cook <[email protected]> To: Tony Luck <[email protected]> To: "Guilherme G. Piccoli" <[email protected]> Cc: [email protected] Signed-off-by: Philipp Hahn <[email protected]> --- 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