提交 1cb1860d 编写于 作者: C Colin Ian King 提交者: David S. Miller

cxgb4: fix -ve error check on a signed iq

iq is unsigned, so the error check for iq < 0 has no effect so errors
can slip past this check.  Fix this by making iq signed and also
get_filter_steerq return a signed int so a -ve error can be returned.
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 bce3414e
...@@ -117,11 +117,11 @@ static int validate_filter(struct net_device *dev, ...@@ -117,11 +117,11 @@ static int validate_filter(struct net_device *dev,
return 0; return 0;
} }
static unsigned int get_filter_steerq(struct net_device *dev, static int get_filter_steerq(struct net_device *dev,
struct ch_filter_specification *fs) struct ch_filter_specification *fs)
{ {
struct adapter *adapter = netdev2adap(dev); struct adapter *adapter = netdev2adap(dev);
unsigned int iq; int iq;
/* If the user has requested steering matching Ingress Packets /* If the user has requested steering matching Ingress Packets
* to a specific Queue Set, we need to make sure it's in range * to a specific Queue Set, we need to make sure it's in range
...@@ -443,10 +443,10 @@ int __cxgb4_set_filter(struct net_device *dev, int filter_id, ...@@ -443,10 +443,10 @@ int __cxgb4_set_filter(struct net_device *dev, int filter_id,
struct filter_ctx *ctx) struct filter_ctx *ctx)
{ {
struct adapter *adapter = netdev2adap(dev); struct adapter *adapter = netdev2adap(dev);
unsigned int max_fidx, fidx, iq; unsigned int max_fidx, fidx;
struct filter_entry *f; struct filter_entry *f;
u32 iconf; u32 iconf;
int ret; int iq, ret;
max_fidx = adapter->tids.nftids; max_fidx = adapter->tids.nftids;
if (filter_id != (max_fidx + adapter->tids.nsftids - 1) && if (filter_id != (max_fidx + adapter->tids.nsftids - 1) &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册