]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx4_core: fix incorrect size allocation for dev->caps.spec_qps
authorColin Ian King <colin.king@canonical.com>
Thu, 31 Aug 2017 17:07:24 +0000 (18:07 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 3 Sep 2017 17:57:10 +0000 (10:57 -0700)
commit7145f806f5bd2bd62ea7f7cad93803ac696c6a19
tree6a28e9af593aca2cea3243d90f64d4a9820f025c
parent789daeba929f487efab93dcd2359c6f0c7de21df
net/mlx4_core: fix incorrect size allocation for dev->caps.spec_qps

The current allocation for dev->caps.spec_qps is for the size of the
pointer and not the size of the actual  mlx4_spec_qps structure.  Fix
this by using the correct size.   Also splint allocation over a few
lines to make it cppcheck clean on overly wide lines.

Detected by CoverityScan, CID#1455222 ("Wrong sizeof argument")

Fixes: 18f2b67393ae ("net/mlx4_core: Dynamically allocate structs at mlx4_slave_cap")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/qp.c