From nobody Fri Jun 12 12:49:01 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2E0A1EA7DB; Fri, 15 May 2026 08:35:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778834134; cv=none; b=abYwfO1sVK4jNav1WD4fWPqzr6LCk3YboBO+QZJB4Vo6srt2ZxIr0Wd1K74IQZmYUfmWplwOOk3XpZqzs3honRNRRRmzhWq98fu/trcx3WF+DX183C6/80UlfGJ+byZtwJVpCXKDK7SQuG1TwzAZMHMrpXt+ubuXrs6cJAstJbk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778834134; c=relaxed/simple; bh=oRDXtWjcRpkqsQJ/to4GEkbJRjIC1OtxzsfADvJ1BK4=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Vkfzys8M9Hjfr+yswULFlXfsTuk86Daibf9zbphXR1E/QnZReKAZmjsPeA/2Bz5GIrOythjJWXsj1ksWqpR5RdtaWwIihy/yNw+8soIb12jIASdKHwYv+S26oghkwt/ewv+W2ZF/MtBeFDjmve0oZITLSQ9c8z1HteV3tZ+z3/M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 057b7a42503911f1aa26b74ffac11d73-20260515 X-CID-CACHE: Type:Local,Time:202605151539+08,HitQuantity:1 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:9b5e8e38-324c-4438-9cc3-3d1b36551f93,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:e7bac3a,CLOUDID:3cdc4bf5ffe5c7fe56ce09ca6f9d0ab2,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:102|850|865|898,TC:nil,Content:0|15|50,E DM:-3,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA :0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 057b7a42503911f1aa26b74ffac11d73-20260515 X-User: zenghongling@kylinos.cn Received: from localhost.localdomain [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 1491212824; Fri, 15 May 2026 16:35:26 +0800 From: Hongling Zeng To: dpenkler@gmail.com, gregkh@linuxfoundation.org, dominik.karol.piatkowski@protonmail.com, adam.quandour@gmail.com, kees@kernel.org Cc: linux-kernel@vger.kernel.org, zhongling0719@126.com, Hongling Zeng , stable@vger.kernel.org Subject: [PATCH] gpib: cb7210: Fix region leak when request_irq fails Date: Fri, 15 May 2026 16:35:21 +0800 Message-Id: <20260515083521.62437-1-zenghongling@kylinos.cn> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When request_irq() fails, the region allocated by request_region() is not released. Fix this by adding an error handling path with proper goto labels to release the region. Fixes: e9dc69956d4d ("staging: gpib: Add Computer Boards GPIB driver") Signed-off-by: Hongling Zeng Cc: stable@vger.kernel.org --- drivers/gpib/cb7210/cb7210.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpib/cb7210/cb7210.c b/drivers/gpib/cb7210/cb7210.c index 6dd8637c5964..673b5bfe2e7d 100644 --- a/drivers/gpib/cb7210/cb7210.c +++ b/drivers/gpib/cb7210/cb7210.c @@ -1049,7 +1049,8 @@ static int cb_isa_attach(struct gpib_board *board, co= nst struct gpib_board_confi if (!request_region(config->ibbase, cb7210_iosize, DRV_NAME)) { dev_err(board->gpib_dev, "ioports starting at 0x%x are already in use\n", config->ibbase); - return -EBUSY; + retval =3D -EBUSY; + goto err_release_region; } nec_priv->iobase =3D config->ibbase; cb_priv->fifo_iobase =3D nec7210_iobase(cb_priv); @@ -1062,11 +1063,16 @@ static int cb_isa_attach(struct gpib_board *board, = const struct gpib_board_confi // install interrupt handler if (request_irq(config->ibirq, cb7210_interrupt, isr_flags, DRV_NAME, boa= rd)) { dev_err(board->gpib_dev, "failed to obtain IRQ %d\n", config->ibirq); - return -EBUSY; + retval =3D -EBUSY; + goto err_release_region; } cb_priv->irq =3D config->ibirq; =20 return cb7210_init(cb_priv, board); + +err_release_region: + release_region(nec7210_iobase(cb_priv), cb7210_iosize); + return retval; } =20 static void cb_isa_detach(struct gpib_board *board) --=20 2.25.1