diff options
author | Chaitanya Kulkarni <[email protected]> | 2023-06-01 22:37:13 -0700 |
---|---|---|
committer | Keith Busch <[email protected]> | 2023-06-12 10:36:59 -0700 |
commit | 900095bfbbf6623fbfa9e5ceb3982f293b6f3275 (patch) | |
tree | f5e023fc9eb7e307fb0d7c54866ca0b1eb028c90 /scripts/generate_rust_analyzer.py | |
parent | bdbfcd5f6caa46e1ddbfd60cbf694d192b37805a (diff) |
nvme-fabrics: error out to unlock the mutex
Currently, in the nvmf_host_add() function, if the nvmf_host_alloc()
call failed to allocate memory for the host, the code would directly
return -ENOMEM without unlocking the nvmf_hosts_mutex. This could
lead to potential issues with mutex synchronization.
Fix that error handling mechanism by jumping to the out_unlock label
when nvmf_host_alloc() fails. This ensures that the mutex is unlocked
before returning the error code. The updated code enhances avoids
possible deadlocks.
Fixes: f0cebf82004d ("nvme-fabrics: prevent overriding of existing host")
Reported-by: kernel test robot <[email protected]>
Reported-by: Julia Lawall <[email protected]>
Closes: https://lore.kernel.org/r/[email protected]/
Signed-off-by: Chaitanya Kulkarni <[email protected]>
Reviewed-by: Julia Lawall <[email protected]>
Reviewed-by: Sagi Grimberg <[email protected]>
Reviewed-by: Max Gurtovoy <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Keith Busch <[email protected]>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions