diff options
author | Ajit Khaparde <ajit.khaparde@emulex.com> | 2011-02-04 18:18:28 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-06 02:58:18 +0100 |
commit | e45ff01d3f79bc71e6f514302a776cc8815eaecc (patch) | |
tree | 47353b13f245a74f2d25fc40ecffe37e9314fe39 /drivers | |
parent | net: can: janz-ican3: world-writable sysfs termination file (diff) | |
download | linux-e45ff01d3f79bc71e6f514302a776cc8815eaecc.tar.xz linux-e45ff01d3f79bc71e6f514302a776cc8815eaecc.zip |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/benet/be_cmds.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index 0c7811faf72c..a179cc6d79f2 100644 --- 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; } |