projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1e6d93e
)
benet: Avoid potential null deref in be_cmd_get_seeprom_data()
author
Ajit Khaparde
<ajit.khaparde@emulex.com>
Fri, 4 Feb 2011 17:18:28 +0000
(17:18 +0000)
committer
David S. Miller
<davem@davemloft.net>
Sun, 6 Feb 2011 01:58:18 +0000
(17:58 -0800)
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>
drivers/net/benet/be_cmds.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/net/benet/be_cmds.c
b/drivers/net/benet/be_cmds.c
index 0c7811faf72cca865eb7725a76cc0b4c4ecbef7d..a179cc6d79f2e636aad7ac5ca4899855f8ec8de0 100644
(file)
--- a/
drivers/net/benet/be_cmds.c
+++ b/
drivers/net/benet/be_cmds.c
@@
-1786,6
+1786,10
@@
int be_cmd_get_seeprom_data(struct be_adapter *adapter,
spin_lock_bh(&adapter->mcc_lock);
wrb = wrb_from_mccq(adapter);
+ if (!wrb) {
+ status = -EBUSY;
+ goto err;
+ }
req = nonemb_cmd->va;
sge = nonembedded_sgl(wrb);
@@
-1801,6
+1805,7
@@
int be_cmd_get_seeprom_data(struct be_adapter *adapter,
status = be_mcc_notify_wait(adapter);
+err:
spin_unlock_bh(&adapter->mcc_lock);
return status;
}