Skip to contentSkip to conversation

gpib: Fix error code in ibonline()

PATCH New Dan Carpenter 1 participant 1 message Nov 28, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpib: Fix error code in ibonline()

This accidentally returns 1 on error, but it should return negative error codes.

Fixes 9dde4559e939 ("staging: gpib: Add GPIB common core driver")
---
 drivers/gpib/common/iblib.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpib/common/iblib.c +2 -3
index 7cbb6a467177..b672dd6aad25 100644
@@ -227,11 +227,10 @@ int ibonline(struct gpib_board *board)
 #ifndef CONFIG_NIOS2
 	board->autospoll_task = kthread_run(&autospoll_thread, board,
 					    "gpib%d_autospoll_kthread", board->minor);
-	retval = IS_ERR(board->autospoll_task);
-	if (retval) {
+	if (IS_ERR(board->autospoll_task)) {
 		dev_err(board->gpib_dev, "failed to create autospoll thread\n");
 		board->interface->detach(board);
-		return retval;
+		return PTR_ERR(board->autospoll_task);
 	}
 #endif
 	board->online = 1;
Signature · 1 line
2.51.0