diff options
| author | Christophe JAILLET <[email protected]> | 2021-06-20 13:28:06 +0000 |
|---|---|---|
| committer | Tony Nguyen <[email protected]> | 2021-06-25 18:30:50 +0000 |
| commit | b81c191c468bb9f9e63cb19cdf090732e3218dce (patch) | |
| tree | 02e13ab3063bf1317a007140ba092462a4738529 /drivers/net/ethernet/intel/ice/ice_dcb_lib.c | |
| parent | ice: remove unnecessary VSI assignment (diff) | |
| download | kernel-b81c191c468bb9f9e63cb19cdf090732e3218dce.tar.gz kernel-b81c191c468bb9f9e63cb19cdf090732e3218dce.zip | |
ice: Fix a memory leak in an error handling path in 'ice_pf_dcb_cfg()'
If this 'kzalloc()' fails we must free some resources as in all the other
error handling paths of this function.
Fixes: 348048e724a0 ("ice: Implement iidc operations")
Signed-off-by: Christophe JAILLET <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_dcb_lib.c')
| -rw-r--r-- | drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c index 857dc62da7a8..926cf748c5ec 100644 --- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c @@ -316,8 +316,10 @@ int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked) /* Notify AUX drivers about impending change to TCs */ event = kzalloc(sizeof(*event), GFP_KERNEL); - if (!event) - return -ENOMEM; + if (!event) { + ret = -ENOMEM; + goto free_cfg; + } set_bit(IIDC_EVENT_BEFORE_TC_CHANGE, event->type); ice_send_event_to_aux(pf, event); |
