]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
isdn: mISDN: hfcsusb: fix memory leak in hfcsusb_probe()
authorAbdun Nihaal <nihaal@cse.iitm.ac.in>
Thu, 30 Oct 2025 04:25:22 +0000 (09:55 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Dec 2025 11:45:19 +0000 (12:45 +0100)
commit475032fa2bb82ffb592c321885e917e39f47357f
tree78065da77ae7a8c0745742a3072f8728dff377f6
parent1f0ab37f10752a295b8f03b1a3b77ca3ca7ed413
isdn: mISDN: hfcsusb: fix memory leak in hfcsusb_probe()

commit 3f978e3f1570155a1327ffa25f60968bc7b9398f upstream.

In hfcsusb_probe(), the memory allocated for ctrl_urb gets leaked when
setup_instance() fails with an error code. Fix that by freeing the urb
before freeing the hw structure. Also change the error paths to use the
goto ladder style.

Compile tested only. Issue found using a prototype static analysis tool.

Fixes: 69f52adb2d53 ("mISDN: Add HFC USB driver")
Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
Link: https://patch.msgid.link/20251030042524.194812-1-nihaal@cse.iitm.ac.in
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/isdn/hardware/mISDN/hfcsusb.c