summaryrefslogtreecommitdiff
path: root/drivers/memstick/host/jmb38x_ms.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/memstick/host/jmb38x_ms.c')
-rw-r--r--drivers/memstick/host/jmb38x_ms.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/memstick/host/jmb38x_ms.c b/drivers/memstick/host/jmb38x_ms.c
index f9a93b0565e1..a7a0f0caea15 100644
--- a/drivers/memstick/host/jmb38x_ms.c
+++ b/drivers/memstick/host/jmb38x_ms.c
@@ -927,8 +927,7 @@ static int jmb38x_ms_probe(struct pci_dev *pdev,
goto err_out_int;
}
- jm = kzalloc(sizeof(struct jmb38x_ms)
- + cnt * sizeof(struct memstick_host *), GFP_KERNEL);
+ jm = kzalloc(struct_size(jm, hosts, cnt), GFP_KERNEL);
if (!jm) {
rc = -ENOMEM;
goto err_out_int;