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


Reply via email to