Commit cd07eadd authored by Jiasheng Jiang's avatar Jiasheng Jiang Committed by Paolo Abeni

octeontx2-pf: Add check for devm_kcalloc

As the devm_kcalloc may return NULL pointer,
it should be better to add check for the return
value, as same as the others.

Fixes: e8e095b3 ("octeontx2-af: cn10k: Bandwidth profiles config support")
Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
Link: https://lore.kernel.org/r/20221122055449.31247-1-jiasheng@iscas.ac.cnSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 290b5fe0
...@@ -4985,6 +4985,8 @@ static int nix_setup_ipolicers(struct rvu *rvu, ...@@ -4985,6 +4985,8 @@ static int nix_setup_ipolicers(struct rvu *rvu,
ipolicer->ref_count = devm_kcalloc(rvu->dev, ipolicer->ref_count = devm_kcalloc(rvu->dev,
ipolicer->band_prof.max, ipolicer->band_prof.max,
sizeof(u16), GFP_KERNEL); sizeof(u16), GFP_KERNEL);
if (!ipolicer->ref_count)
return -ENOMEM;
} }
/* Set policer timeunit to 2us ie (19 + 1) * 100 nsec = 2us */ /* Set policer timeunit to 2us ie (19 + 1) * 100 nsec = 2us */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment