Commit a2f054c
iavf: fix potential deadlock on allocation failure
In iavf_adminq_task(), if kzalloc() fails to allocate the event.msg_buf,
the function will exit without releasing the adapter->crit_lock.
This is unlikely, but if it happens, the next access to that mutex will
deadlock.
Fix this by moving the unlock to the end of the function, and adding a new
label to allow jumping to the unlock portion of the function exit flow.
Fixes: fc2e6b3 ("iavf: Rework mutexes for better synchronisation")
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>1 parent 043b1f1 commit a2f054c
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3264 | 3264 | | |
3265 | 3265 | | |
3266 | 3266 | | |
3267 | | - | |
| 3267 | + | |
3268 | 3268 | | |
3269 | 3269 | | |
3270 | 3270 | | |
| |||
3279 | 3279 | | |
3280 | 3280 | | |
3281 | 3281 | | |
3282 | | - | |
3283 | 3282 | | |
3284 | 3283 | | |
3285 | 3284 | | |
| |||
3323 | 3322 | | |
3324 | 3323 | | |
3325 | 3324 | | |
| 3325 | + | |
| 3326 | + | |
3326 | 3327 | | |
3327 | 3328 | | |
3328 | 3329 | | |
| |||
0 commit comments