From: Dan Carpenter <dan.carpenter@linaro.org>
To: Even Xu <even.xu@intel.com>
Cc: Xinpeng Sun <xinpeng.sun@intel.com>,
Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <bentiss@kernel.org>,
Mark Pearson <mpearson-lenovo@squebb.ca>,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH next] HID: intel-thc-hid: intel-thc: Fix error code in thc_i2c_subip_init()
Date: Mon, 13 Jan 2025 09:15:41 +0300 [thread overview]
Message-ID: <eb4ea363-c3b7-4988-9ff5-5ed74bf47620@stanley.mountain> (raw)
Return -ENOMEM if the allocation fails. Don't return success.
Fixes: 4228966def88 ("HID: intel-thc-hid: intel-thc: Add THC I2C config interfaces")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c b/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c
index 92a1dbe9a928..4fc78b5a04b5 100644
--- a/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c
+++ b/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c
@@ -1519,7 +1519,7 @@ int thc_i2c_subip_init(struct thc_device *dev, const u32 target_address,
dev->i2c_subip_regs = devm_kzalloc(dev->dev, sizeof(i2c_subip_regs), GFP_KERNEL);
if (!dev->i2c_subip_regs)
- return PTR_ERR(dev->i2c_subip_regs);
+ return -ENOMEM;
return 0;
}
--
2.45.2
next reply other threads:[~2025-01-13 6:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-13 6:15 Dan Carpenter [this message]
2025-01-13 6:42 ` Xu, Even
2025-01-13 10:08 ` Benjamin Tissoires
2025-01-14 0:14 ` Xu, Even
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=eb4ea363-c3b7-4988-9ff5-5ed74bf47620@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=bentiss@kernel.org \
--cc=even.xu@intel.com \
--cc=jikos@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpearson-lenovo@squebb.ca \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=xinpeng.sun@intel.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®