[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <2ef267c.c4.1844d8ef2d8.Coremail.wangkailong@jari.cn>
Date: Sun, 6 Nov 2022 23:28:44 +0800 (GMT+08:00)
From: wangkailong@...i.cn
To: benh@...nel.crashing.org, mpe@...erman.id.au,
gregkh@...uxfoundation.org, sohu0106@....com,
christophe.leroy@...roup.eu
Cc: linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: [PATCH] macintosh/adb: Fix warning comparing pointer to 0
Fix the following coccicheck warning:
drivers/macintosh/adb.c:676:14-15: WARNING comparing pointer to 0.
Signed-off-by: KaiLong Wang <wangkailong@...i.cn>
---
drivers/macintosh/adb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index 1bbb9ca08d40..076253599bd4 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -673,7 +673,7 @@ static int adb_open(struct inode *inode, struct file *file)
goto out;
}
state = kmalloc(sizeof(struct adbdev_state), GFP_KERNEL);
- if (state == 0) {
+ if (state) {
ret = -ENOMEM;
goto out;
}
--
2.25.1
Powered by blists - more mailing lists