From nobody Fri Jun 12 12:48:49 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 5FD1D3F077F for ; Fri, 15 May 2026 07:40:02 +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=1778830806; cv=none; b=R82VMWOoJCeESETOdtFC0LF0mBGI01/iZredWwwthXvC5E4y3lptz/pfFCZ8ek+Pb9n01VclgCE3HoniUKNzrs4sjNM0f1FSz7HDRH9U7DCLWfQMztmI2p1eoEfBZNZMimEqqnNeBklH5DSRj/aHP2kCb+ru4eehzg5k3YW1zik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778830806; c=relaxed/simple; bh=ZXCfmzinWjdaWSVjlONY3N48ZQm3zyhyG85cTWSLnBI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=pQuJh+fCCNrWwGdcbBxM+HQ0koMk+pJ75BHphND3e2NKoQqG2Z758ZtuZenzwZ3rd2zw4N3rLHn7LppZrbVWRfDSDahWH/SozVMo1smOQ9YDmHnhcoMNMSsUUlcgLmPMjynECAcWMWwDz6OyG/MerotSlnz0IQD+h1HBqmdvsps= 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: 450d81b2503111f1aa26b74ffac11d73-20260515 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:3b2df94b-8141-461e-a10d-808ae7b76c1e,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: 450d81b2503111f1aa26b74ffac11d73-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 1298614419; Fri, 15 May 2026 15:39:56 +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 Subject: [PATCH] gpib: cb7210: Fix region leak when request_irq fails Date: Fri, 15 May 2026 15:39:52 +0800 Message-Id: <20260515073952.54359-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: 82e3508046f9b ("gpib: cb7210: add isa support module") Signed-off-by: Hongling Zeng --- 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..7b0af517cf14 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; + ret =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