Commit 66a04abf authored by David S. Miller's avatar 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: default avatarDavid S. Miller <davem@davemloft.net>
parents 33403121 4ca6dee5
...@@ -1972,7 +1972,7 @@ alloc_channel(struct dpaa2_eth_priv *priv) ...@@ -1972,7 +1972,7 @@ alloc_channel(struct dpaa2_eth_priv *priv)
channel->dpcon = setup_dpcon(priv); channel->dpcon = setup_dpcon(priv);
if (IS_ERR_OR_NULL(channel->dpcon)) { if (IS_ERR_OR_NULL(channel->dpcon)) {
err = PTR_ERR(channel->dpcon); err = PTR_ERR_OR_ZERO(channel->dpcon);
goto err_setup; goto err_setup;
} }
...@@ -2028,7 +2028,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv) ...@@ -2028,7 +2028,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv)
/* Try to allocate a channel */ /* Try to allocate a channel */
channel = alloc_channel(priv); channel = alloc_channel(priv);
if (IS_ERR_OR_NULL(channel)) { if (IS_ERR_OR_NULL(channel)) {
err = PTR_ERR(channel); err = PTR_ERR_OR_ZERO(channel);
if (err != -EPROBE_DEFER) if (err != -EPROBE_DEFER)
dev_info(dev, dev_info(dev,
"No affine channel for cpu %d and above\n", i); "No affine channel for cpu %d and above\n", i);
......
...@@ -467,7 +467,7 @@ enum dpaa2_eth_rx_dist { ...@@ -467,7 +467,7 @@ enum dpaa2_eth_rx_dist {
#define DPAA2_ETH_DIST_IPPROTO BIT(6) #define DPAA2_ETH_DIST_IPPROTO BIT(6)
#define DPAA2_ETH_DIST_L4SRC BIT(7) #define DPAA2_ETH_DIST_L4SRC BIT(7)
#define DPAA2_ETH_DIST_L4DST BIT(8) #define DPAA2_ETH_DIST_L4DST BIT(8)
#define DPAA2_ETH_DIST_ALL (~0U) #define DPAA2_ETH_DIST_ALL (~0ULL)
static inline static inline
unsigned int dpaa2_eth_needed_headroom(struct dpaa2_eth_priv *priv, unsigned int dpaa2_eth_needed_headroom(struct dpaa2_eth_priv *priv,
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
*/ */
#include <linux/net_tstamp.h> #include <linux/net_tstamp.h>
#include <linux/nospec.h>
#include "dpni.h" /* DPNI_LINK_OPT_* */ #include "dpni.h" /* DPNI_LINK_OPT_* */
#include "dpaa2-eth.h" #include "dpaa2-eth.h"
...@@ -648,6 +649,8 @@ static int dpaa2_eth_get_rxnfc(struct net_device *net_dev, ...@@ -648,6 +649,8 @@ static int dpaa2_eth_get_rxnfc(struct net_device *net_dev,
case ETHTOOL_GRXCLSRULE: case ETHTOOL_GRXCLSRULE:
if (rxnfc->fs.location >= max_rules) if (rxnfc->fs.location >= max_rules)
return -EINVAL; return -EINVAL;
rxnfc->fs.location = array_index_nospec(rxnfc->fs.location,
max_rules);
if (!priv->cls_rules[rxnfc->fs.location].in_use) if (!priv->cls_rules[rxnfc->fs.location].in_use)
return -EINVAL; return -EINVAL;
rxnfc->fs = priv->cls_rules[rxnfc->fs.location].fs; rxnfc->fs = priv->cls_rules[rxnfc->fs.location].fs;
......
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