Repository navigation
Commit 8ee7ef4
net: fec: fix the potential memory leak in fec_enet_init()
[ Upstream commit 619fee9 ]
If the memory allocated for cbd_base is failed, it should
free the memory allocated for the queues, otherwise it causes
memory leak.
And if the memory allocated for the queues is failed, it can
return error directly.
Fixes: 59d0f74 ("net: fec: init multi queue date structure")
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 9c38601 commit 8ee7ef4
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3277 | 3277 | | |
3278 | 3278 | | |
3279 | 3279 | | |
3280 | | - | |
| 3280 | + | |
| 3281 | + | |
| 3282 | + | |
3281 | 3283 | | |
3282 | 3284 | | |
3283 | 3285 | | |
3284 | 3286 | | |
3285 | 3287 | | |
3286 | 3288 | | |
3287 | 3289 | | |
3288 | | - | |
| 3290 | + | |
| 3291 | + | |
3289 | 3292 | | |
3290 | 3293 | | |
3291 | 3294 | | |
| |||
3363 | 3366 | | |
3364 | 3367 | | |
3365 | 3368 | | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
3366 | 3373 | | |
3367 | 3374 | | |
3368 | 3375 | | |
| |||
0 commit comments