From: Osama Muhammad <osmtendev@gmail.com>
To: david.rheinsberg@gmail.com, benjamin.tissoires@redhat.com
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Osama Muhammad <osmtendev@gmail.com>
Subject: [PATCH] hid-wiimote-debug.c: Fix error checking for debugfs_create_file
Date: Tue, 23 May 2023 22:12:40 +0500 [thread overview]
Message-ID: <20230523171240.12930-1-osmtendev@gmail.com> (raw)
This patch fixes the error checking in hid-wiimote-debug.c in
debugfs_create_file. The correct way to check if an error occurred
is 'IS_ERR' inline function.
Signed-off-by: Osama Muhammad <osmtendev@gmail.com>
---
drivers/hid/hid-wiimote-debug.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-wiimote-debug.c b/drivers/hid/hid-wiimote-debug.c
index a99dcca2e099..eddd981fee1a 100644
--- a/drivers/hid/hid-wiimote-debug.c
+++ b/drivers/hid/hid-wiimote-debug.c
@@ -183,12 +183,12 @@ int wiidebug_init(struct wiimote_data *wdata)
dbg->eeprom = debugfs_create_file("eeprom", S_IRUSR,
dbg->wdata->hdev->debug_dir, dbg, &wiidebug_eeprom_fops);
- if (!dbg->eeprom)
+ if (IS_ERR(dbg->eeprom))
goto err;
dbg->drm = debugfs_create_file("drm", S_IRUSR,
dbg->wdata->hdev->debug_dir, dbg, &wiidebug_drm_fops);
- if (!dbg->drm)
+ if (IS_ERR(dbg->drm))
goto err_drm;
spin_lock_irqsave(&wdata->state.lock, flags);
--
2.34.1
next reply other threads:[~2023-05-23 17:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-23 17:12 Osama Muhammad [this message]
2023-05-30 10:48 ` [PATCH] hid-wiimote-debug.c: Fix error checking for debugfs_create_file David Rheinsberg
2023-05-30 11:04 ` Osama Muhammad
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=20230523171240.12930-1-osmtendev@gmail.com \
--to=osmtendev@gmail.com \
--cc=benjamin.tissoires@redhat.com \
--cc=david.rheinsberg@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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