aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/mlx4
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2007-05-19 08:51:57 -0700
committerRoland Dreier <rolandd@cisco.com>2007-05-19 08:51:57 -0700
commit23c15c21d34a4b4b4d7b9a95ce498991c5339c77 (patch)
tree7294414512272d9a1d516c779542b9aff84a9f25 /drivers/net/mlx4
parent65adfa911a3522c1e40e55afd472dd571dc2431b (diff)
mlx4_core: Fix array overrun in dump_dev_cap_flags()
Don't overrun fname[] array when decoding device flags. This was spotted by the Coverity checker (CID 1642). Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/net/mlx4')
-rw-r--r--drivers/net/mlx4/fw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/mlx4/fw.c b/drivers/net/mlx4/fw.c
index c4271731366..cfa5cc07233 100644
--- a/drivers/net/mlx4/fw.c
+++ b/drivers/net/mlx4/fw.c
@@ -90,7 +90,7 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u32 flags)
int i;
mlx4_dbg(dev, "DEV_CAP flags:\n");
- for (i = 0; i < 32; ++i)
+ for (i = 0; i < ARRAY_SIZE(fname); ++i)
if (fname[i] && (flags & (1 << i)))
mlx4_dbg(dev, " %s\n", fname[i]);
}