提交 66a04abf 编写于 作者: D David S. Miller

Merge branch 'dpaa2-eth-Fix-smatch-warnings'

Ioana Radulescu says:

====================
dpaa2-eth: Fix smatch warnings

Fix a couple of warnings reported by smatch.
====================
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
......@@ -1972,7 +1972,7 @@ alloc_channel(struct dpaa2_eth_priv *priv)
channel->dpcon = setup_dpcon(priv);
if (IS_ERR_OR_NULL(channel->dpcon)) {
err = PTR_ERR(channel->dpcon);
err = PTR_ERR_OR_ZERO(channel->dpcon);
goto err_setup;
}
......@@ -2028,7 +2028,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv)
/* Try to allocate a channel */
channel = alloc_channel(priv);
if (IS_ERR_OR_NULL(channel)) {
err = PTR_ERR(channel);
err = PTR_ERR_OR_ZERO(channel);
if (err != -EPROBE_DEFER)
dev_info(dev,
"No affine channel for cpu %d and above\n", i);
......
......@@ -467,7 +467,7 @@ enum dpaa2_eth_rx_dist {
#define DPAA2_ETH_DIST_IPPROTO BIT(6)
#define DPAA2_ETH_DIST_L4SRC BIT(7)
#define DPAA2_ETH_DIST_L4DST BIT(8)
#define DPAA2_ETH_DIST_ALL (~0U)
#define DPAA2_ETH_DIST_ALL (~0ULL)
static inline
unsigned int dpaa2_eth_needed_headroom(struct dpaa2_eth_priv *priv,
......
......@@ -4,6 +4,7 @@
*/
#include <linux/net_tstamp.h>
#include <linux/nospec.h>
#include "dpni.h" /* DPNI_LINK_OPT_* */
#include "dpaa2-eth.h"
......@@ -648,6 +649,8 @@ static int dpaa2_eth_get_rxnfc(struct net_device *net_dev,
case ETHTOOL_GRXCLSRULE:
if (rxnfc->fs.location >= max_rules)
return -EINVAL;
rxnfc->fs.location = array_index_nospec(rxnfc->fs.location,
max_rules);
if (!priv->cls_rules[rxnfc->fs.location].in_use)
return -EINVAL;
rxnfc->fs = priv->cls_rules[rxnfc->fs.location].fs;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册