diff options
Diffstat (limited to 'drivers/infiniband/core/device.c')
| -rw-r--r-- | drivers/infiniband/core/device.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index 84f51386e1e3..6fa4c59dc7a7 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c | |||
| @@ -336,8 +336,8 @@ static int read_port_immutable(struct ib_device *device) | |||
| 336 | * Therefore port_immutable is declared as a 1 based array with | 336 | * Therefore port_immutable is declared as a 1 based array with |
| 337 | * potential empty slots at the beginning. | 337 | * potential empty slots at the beginning. |
| 338 | */ | 338 | */ |
| 339 | device->port_immutable = kzalloc(sizeof(*device->port_immutable) | 339 | device->port_immutable = kcalloc(end_port + 1, |
| 340 | * (end_port + 1), | 340 | sizeof(*device->port_immutable), |
| 341 | GFP_KERNEL); | 341 | GFP_KERNEL); |
| 342 | if (!device->port_immutable) | 342 | if (!device->port_immutable) |
| 343 | return -ENOMEM; | 343 | return -ENOMEM; |
