mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
benet: Avoid potential null deref in be_cmd_get_seeprom_data()
Found by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1e6d93e45b
commit
e45ff01d3f
1 changed files with 5 additions and 0 deletions
|
@ -1786,6 +1786,10 @@ int be_cmd_get_seeprom_data(struct be_adapter *adapter,
|
||||||
spin_lock_bh(&adapter->mcc_lock);
|
spin_lock_bh(&adapter->mcc_lock);
|
||||||
|
|
||||||
wrb = wrb_from_mccq(adapter);
|
wrb = wrb_from_mccq(adapter);
|
||||||
|
if (!wrb) {
|
||||||
|
status = -EBUSY;
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
req = nonemb_cmd->va;
|
req = nonemb_cmd->va;
|
||||||
sge = nonembedded_sgl(wrb);
|
sge = nonembedded_sgl(wrb);
|
||||||
|
|
||||||
|
@ -1801,6 +1805,7 @@ int be_cmd_get_seeprom_data(struct be_adapter *adapter,
|
||||||
|
|
||||||
status = be_mcc_notify_wait(adapter);
|
status = be_mcc_notify_wait(adapter);
|
||||||
|
|
||||||
|
err:
|
||||||
spin_unlock_bh(&adapter->mcc_lock);
|
spin_unlock_bh(&adapter->mcc_lock);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue