FreeBSD Bugzilla – Attachment 235186 Details for
Bug 265147
bhnd: fix potential resource leak in bhnd_usb_attach()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
a possible patch
bhnd-fix-potential-resource-leak-in-bhnd_usb_attach.patch (text/plain), 1.09 KB, created by
niejianglei2021@163.com
on 2022-07-11 07:58:33 UTC
(
hide
)
Description:
a possible patch
Filename:
MIME Type:
Creator:
niejianglei2021@163.com
Created:
2022-07-11 07:58:33 UTC
Size:
1.09 KB
patch
obsolete
>From cd1023f8c05497cb9bb28ba2479026c086a2f529 Mon Sep 17 00:00:00 2001 >From: Jianglei Nie <niejianglei2021@163.com> >Date: Mon, 11 Jul 2022 09:46:45 +0800 >Subject: [PATCH] bhnd: fix potential resource leak in bhnd_usb_attach() > >bhnd_usb_attach() allocates PMU for dev with bhnd_alloc_pmu(). When >bhnd_request_ext_rsrc() fails, relevant resource is not released, which >will lead to a resource leak. > >We should release the relevant resource with bhnd_release_pmu() when >bhnd_request_ext_rsrc() fails to avoid the resource leak. > >Signed-off-by: Jianglei Nie <niejianglei2021@163.com> >--- > sys/dev/bhnd/cores/usb/bhnd_usb.c | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/sys/dev/bhnd/cores/usb/bhnd_usb.c b/sys/dev/bhnd/cores/usb/bhnd_usb.c >index a3471695a6aa..ceb61b63a4d1 100644 >--- a/sys/dev/bhnd/cores/usb/bhnd_usb.c >+++ b/sys/dev/bhnd/cores/usb/bhnd_usb.c >@@ -174,6 +174,7 @@ bhnd_usb_attach(device_t dev) > err = bhnd_request_ext_rsrc(dev, 1); > if(err) { > BHND_ERROR_DEV(dev, "can't req ext: %d", err); >+ bhnd_release_pmu(dev); > return (err); > } > /* Take out of resets */ >-- >2.25.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 265147
: 235186