Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e45ff01d authored by Ajit Khaparde's avatar Ajit Khaparde Committed by David S. Miller
Browse files

benet: Avoid potential null deref in be_cmd_get_seeprom_data()



Found by: Jesper Juhl <jj@chaosbits.net>

Signed-off-by: default avatarAjit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1e6d93e4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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;
}