Commit 3fd2f4b
dmaengine: idxd: fix memory leak in error handling path of idxd_setup_wqs
Memory allocated for wqs is not freed if an error occurs during
idxd_setup_wqs(). To fix it, free the allocated memory in the reverse
order of allocation before exiting the function in case of an error.
Fixes: 7c5dd23 ("dmaengine: idxd: fix wq conf_dev 'struct device' lifetime")
Fixes: 700af3a ("dmaengine: idxd: add 'struct idxd_dev' as wrapper for conf_dev")
Fixes: de5819b ("dmaengine: idxd: track enabled workqueues in bitmap")
Fixes: b0325ae ("dmaengine: idxd: add WQ operation cap restriction support")
Cc: stable@vger.kernel.org
Signed-off-by: Shuai Xue <xueshuai@linux.alibaba.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Fenghua Yu <fenghuay@nvidia.com>
Link: https://lore.kernel.org/r/20250404120217.48772-2-xueshuai@linux.alibaba.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>1 parent 305245a commit 3fd2f4b
1 file changed
+21
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
173 | | - | |
| 172 | + | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
193 | | - | |
| 192 | + | |
194 | 193 | | |
195 | | - | |
196 | 194 | | |
197 | 195 | | |
198 | 196 | | |
| |||
203 | 201 | | |
204 | 202 | | |
205 | 203 | | |
206 | | - | |
207 | 204 | | |
208 | 205 | | |
209 | 206 | | |
210 | 207 | | |
211 | 208 | | |
212 | 209 | | |
213 | 210 | | |
214 | | - | |
215 | 211 | | |
216 | | - | |
| 212 | + | |
217 | 213 | | |
218 | 214 | | |
219 | 215 | | |
| |||
224 | 220 | | |
225 | 221 | | |
226 | 222 | | |
227 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
228 | 230 | | |
229 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
230 | 235 | | |
231 | 236 | | |
| 237 | + | |
| 238 | + | |
232 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
233 | 245 | | |
234 | 246 | | |
235 | 247 | | |
| |||
0 commit comments