drivers/memstick/core/mspro_block.c: fix attributes array allocation
[firefly-linux-kernel-4.4.55.git] / drivers / memstick / core / mspro_block.c
index f4176ca3a794ee2c684d35e3461da165b1abc7ce..fc145d202c46907cf1ed40572068fcf3d21441c1 100644 (file)
@@ -1023,8 +1023,8 @@ static int mspro_block_read_attributes(struct memstick_dev *card)
        } else
                attr_count = attr->count;
 
-       msb->attr_group.attrs = kzalloc((attr_count + 1)
-                                       * sizeof(struct attribute),
+       msb->attr_group.attrs = kcalloc(attr_count + 1,
+                                       sizeof(*msb->attr_group.attrs),
                                        GFP_KERNEL);
        if (!msb->attr_group.attrs) {
                rc = -ENOMEM;