mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: wangkailong@jari.cn
To: benh@kernel.crashing.org, mpe@ellerman.id.au,
	gregkh@linuxfoundation.org, sohu0106@126.com,
	christophe.leroy@csgroup.eu
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: [PATCH] macintosh/adb: Fix warning comparing pointer to 0
Date: Sun, 6 Nov 2022 23:28:44 +0800 (GMT+08:00)	[thread overview]
Message-ID: <2ef267c.c4.1844d8ef2d8.Coremail.wangkailong@jari.cn> (raw)

Fix the following coccicheck warning:

drivers/macintosh/adb.c:676:14-15: WARNING comparing pointer to 0.

Signed-off-by: KaiLong Wang <wangkailong@jari.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

             reply	other threads:[~2022-11-06 15:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-06 15:28 wangkailong [this message]
2022-11-06 16:12 ` Christophe JAILLET
2022-11-06 17:13   ` Christophe Leroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2ef267c.c4.1844d8ef2d8.Coremail.wangkailong@jari.cn \
    --to=wangkailong@jari.cn \
    --cc=benh@kernel.crashing.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=sohu0106@126.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®