mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 12:25:00 -04:00
i40e: add max boundary check for VF filters
commit cb79fa7118c150c3c76a327894bb2eb878c02619 upstream.
There is no check for max filters that VF can request. Add it.
Fixes: e284fc2804 ("i40e: Add and delete cloud filter")
Cc: stable@vger.kernel.org
Signed-off-by: Lukasz Czapnik <lukasz.czapnik@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a88c1b2746
commit
9176e18681
1 changed files with 10 additions and 0 deletions
|
|
@ -3665,6 +3665,8 @@ err:
|
|||
aq_ret);
|
||||
}
|
||||
|
||||
#define I40E_MAX_VF_CLOUD_FILTER 0xFF00
|
||||
|
||||
/**
|
||||
* i40e_vc_add_cloud_filter
|
||||
* @vf: pointer to the VF info
|
||||
|
|
@ -3704,6 +3706,14 @@ static int i40e_vc_add_cloud_filter(struct i40e_vf *vf, u8 *msg)
|
|||
goto err_out;
|
||||
}
|
||||
|
||||
if (vf->num_cloud_filters >= I40E_MAX_VF_CLOUD_FILTER) {
|
||||
dev_warn(&pf->pdev->dev,
|
||||
"VF %d: Max number of filters reached, can't apply cloud filter\n",
|
||||
vf->vf_id);
|
||||
aq_ret = -ENOSPC;
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
cfilter = kzalloc(sizeof(*cfilter), GFP_KERNEL);
|
||||
if (!cfilter)
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
Loading…
Reference in a new issue