mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
bnx2fc: do not scan uninitialized lists in case of error.
In case of of error, the bnx2fc_cmd_mgr_alloc() function will call the bnx2fc_cmd_mgr_free() to perform the cleanup. The problem is that in one case the latter may try to scan some not-yet initialized lists, resulting in a kernel panic. This patch prevents this from happening by freeing the lists before calling bnx2fc_cmd_mgr_free(). Signed-off-by: Maurizio Lombardi <[email protected]> Acked-by: Eddie Wai <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
This commit is contained in:
parent
0353e085ed
commit
9172b763a7
1 changed files with 2 additions and 0 deletions
|
|
@ -282,6 +282,8 @@ struct bnx2fc_cmd_mgr *bnx2fc_cmd_mgr_alloc(struct bnx2fc_hba *hba)
|
|||
arr_sz, GFP_KERNEL);
|
||||
if (!cmgr->free_list_lock) {
|
||||
printk(KERN_ERR PFX "failed to alloc free_list_lock\n");
|
||||
kfree(cmgr->free_list);
|
||||
cmgr->free_list = NULL;
|
||||
goto mem_err;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue