Commit ea79363
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: 69f52ad ("mISDN: Add HFC USB driver")
Signed-off-by: Abdun Nihaal <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent 350d846 commit ea79363
1 file changed
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1904 | 1904 | | |
1905 | 1905 | | |
1906 | 1906 | | |
1907 | | - | |
1908 | 1907 | | |
1909 | 1908 | | |
1910 | 1909 | | |
1911 | 1910 | | |
1912 | 1911 | | |
1913 | 1912 | | |
| 1913 | + | |
1914 | 1914 | | |
1915 | 1915 | | |
1916 | 1916 | | |
| |||
2101 | 2101 | | |
2102 | 2102 | | |
2103 | 2103 | | |
2104 | | - | |
2105 | | - | |
| 2104 | + | |
| 2105 | + | |
2106 | 2106 | | |
2107 | 2107 | | |
2108 | 2108 | | |
2109 | 2109 | | |
2110 | 2110 | | |
2111 | 2111 | | |
2112 | | - | |
2113 | | - | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
2114 | 2116 | | |
2115 | 2117 | | |
2116 | 2118 | | |
2117 | 2119 | | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
2118 | 2126 | | |
2119 | 2127 | | |
2120 | 2128 | | |
| |||
0 commit comments