mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH next] HID: intel-thc-hid: intel-thc: Fix error code in thc_i2c_subip_init()
@ 2025-01-13  6:15 Dan Carpenter
  2025-01-13  6:42 ` Xu, Even
  2025-01-13 10:08 ` Benjamin Tissoires
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2025-01-13  6:15 UTC (permalink / raw)
  To: Even Xu
  Cc: Xinpeng Sun, Jiri Kosina, Benjamin Tissoires, Mark Pearson,
	Srinivas Pandruvada, linux-input, linux-kernel, kernel-janitors

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-01-14  0:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-13  6:15 [PATCH next] HID: intel-thc-hid: intel-thc: Fix error code in thc_i2c_subip_init() Dan Carpenter
2025-01-13  6:42 ` Xu, Even
2025-01-13 10:08 ` Benjamin Tissoires
2025-01-14  0:14   ` Xu, Even

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®