diff options
author | Tomer Tayar <Tomer.Tayar@cavium.com> | 2017-05-21 12:10:56 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-05-21 19:56:53 +0300 |
commit | 3587cb87cc44ce16581dd7908d74ea91984f93b6 (patch) | |
tree | 442b02b8dbe1bcdedf588c79b192eb6429ead7b6 /drivers/net/ethernet/qlogic/qed/qed_dcbx.c | |
parent | 492a1d9811cbd17c833bd0af18bfaff00cd3ac85 (diff) | |
download | linux-3587cb87cc44ce16581dd7908d74ea91984f93b6.tar.xz |
qed: Revise alloc/setup/free flow
Re-organize the logic that allocates and frees memory of various
sub-components of the hw-function -
a. No need to pass pointers to said structure as parameters;
The internal logic knows exactly where to find/set the data.
b. Nullify pointers after cleanup to prevent possible errors to
re-entrant code.
Signed-off-by: Tomer Tayar <Tomer.Tayar@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qed/qed_dcbx.c')
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c index b7ca0e2181c4..b83fe1d9e988 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c @@ -923,6 +923,7 @@ int qed_dcbx_info_alloc(struct qed_hwfn *p_hwfn) void qed_dcbx_info_free(struct qed_hwfn *p_hwfn) { kfree(p_hwfn->p_dcbx_info); + p_hwfn->p_dcbx_info = NULL; } static void qed_dcbx_update_protocol_data(struct protocol_dcb_data *p_data, |