Merge tag 'hwlock-v4.18' of git://github.com/andersson/remoteproc
[muen/linux.git] / drivers / hwspinlock / u8500_hsem.c
index 84a92d424e8d2674082525ad56c2b9c95b4c0c1f..572ca79d77e8fc34a96df43075315ee977ee8a07 100644 (file)
@@ -111,7 +111,7 @@ static int u8500_hsem_probe(struct platform_device *pdev)
        /* clear all interrupts */
        writel(0xFFFF, io_base + HSEM_ICRALL);
 
-       bank = kzalloc(sizeof(*bank) + num_locks * sizeof(*hwlock), GFP_KERNEL);
+       bank = kzalloc(struct_size(bank, lock, num_locks), GFP_KERNEL);
        if (!bank) {
                ret = -ENOMEM;
                goto iounmap_base;