Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1953825pxp; Mon, 21 Mar 2022 08:20:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRK+N/C8Ka+/qTCJtyGjSXw3WMqviiPcrjB4f66C5eBF+5dJ2kG7jbhDTqDyW1RswX1+Sm X-Received: by 2002:a17:902:d4c8:b0:154:2416:2185 with SMTP id o8-20020a170902d4c800b0015424162185mr13424262plg.25.1647876003090; Mon, 21 Mar 2022 08:20:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647876003; cv=none; d=google.com; s=arc-20160816; b=X5GzzBfmFdOdGWM0kLzpu4/gdlDsgMF2b/7Nz8aWktg6DNmU4FzZglO7TZuCrw7QGY +4fEDM5Ob0EJjbeEJImJyI8P2dD+igPr9jc7Ysr0Yst/Zox78AA5uJokjSAoWnB03WDG MgS/hDNH+hL5iYoWWVvUbluLZl2Nf9tP5YA+ZG0uT2BTCc+7ZzLqBzvg1zZdy+7+ofl2 /p86YOcoQNbjrkrf8PjPGG14+gSsF32XW08+FacnSOGswI2dO/PF3l0HfZjF59tW3pI3 LnoycGjr4jbskdsqgkuZQpU8qcG9bfqU52U2Tyh49pFHeIklXdW3tam14TGZFXpjTE0/ 2Qig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=eOMRj1XVqYhfRtL+8zbvkj9G0h1ouLrO0mIz9DEaP/E=; b=TQL5G9flZiF49mF7vaFdLiWD0aeENQxBFgwHA/8EfZh5pDjMzKTb0w+SGScFKC7xm/ sU0/GDrEshaA8i3H5GvIAKQ8NaP8LOtxCTAdH5UpYZkAHFeaqebAeo009i0qqNSMK0+E qwlPep4DFmTYE7G6oNbjsYTT6WRsKWGuqYJGiaFaPRODJie2hX7vEVSw+rvG7dOY3sZO QRckEwF+FM664HO/aI2Y8ioQcpdIs7GITIqaRZ+yUtN/ZTHGTbkJjp/2itZdvI25WZ14 wFf3PA2fKSxvO82pgW1+D3ci95CwlXdcnqsjjANEH3ss3OTjW4yE7Nt1/vMeVlbIWrAh T+9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TvlksU+F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i17-20020a631311000000b003829aca2624si1515525pgl.460.2022.03.21.08.19.49; Mon, 21 Mar 2022 08:20:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TvlksU+F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244157AbiCSUhO (ORCPT + 99 others); Sat, 19 Mar 2022 16:37:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235693AbiCSUhO (ORCPT ); Sat, 19 Mar 2022 16:37:14 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85A9018F236; Sat, 19 Mar 2022 13:35:52 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id w25so13862646edi.11; Sat, 19 Mar 2022 13:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eOMRj1XVqYhfRtL+8zbvkj9G0h1ouLrO0mIz9DEaP/E=; b=TvlksU+FJkEucyu3UgBU4m6nfRwZuyAMLjIXpohgdKCofMKVS5LvjF+bIXTrJPsLOc y8WCJxgDdmHw042HSGqEjFEqFTfZSIpJg4L5KqLEbsz9vEWSQxkTP+HvIRYiw1E6j2aq FbApQMa9hSO0zP9vyO+wxG+9Zmmsve/z+y771TUIaqj8tgxEQ3mmRRFdOAhGLtvwkpjQ /56SP3xmKbhVSOr0RnviOc7WYySYYxcAfnZt/fW8LDu0Ex7ROsb3tt/zDYAkAKq8HHus tuFd7/Sd/Ia2cX1CPA9c4c7rhIHKU4R4hgccO177OPNN9+dCDmLfEBt06H1WHQk44rQt TE6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eOMRj1XVqYhfRtL+8zbvkj9G0h1ouLrO0mIz9DEaP/E=; b=d08IVXJ+QUxKe2QVFIXPdEtNugsHjrrP+fdckCfD5V07SjqqjsRdILjst/wthMX8/U SWO31/mov5NkeQsukys1EEFa/WOnx1lsMKpX3WiCMfM/Ale4oqbnHZwjUFTxgJX3S1QW cWos9NrH6M+yUDZI9FUm09hjM4KY64mcjxviBzgJNq+ZfCE8eseF9nv/d19Dx5m88LEE Lwjdt7vgE6l/0PrN2MkBxWRY/Xy/y6kyBHISMiidcLD+ZJGVo2Brb4pX6cv0jOAmCdSj U9kHXeOvPtb9Fk/t9ZUJ9+btetJoAlwsu9iQDdCLIR1Xvd8212JmCYdyRAzF2DHe241L bsHA== X-Gm-Message-State: AOAM533lt9QUJhu2yvaH8gxLh5JU+SUx4ehIeARik7UnisNSKanGm0H/ zUr96WTyA3avL7kpGuCsloY= X-Received: by 2002:a05:6402:2794:b0:419:2ed8:f36e with SMTP id b20-20020a056402279400b004192ed8f36emr856674ede.44.1647722151064; Sat, 19 Mar 2022 13:35:51 -0700 (PDT) Received: from localhost.localdomain (i130160.upc-i.chello.nl. [62.195.130.160]) by smtp.googlemail.com with ESMTPSA id m24-20020a170906161800b006d420027b63sm5181902ejd.18.2022.03.19.13.35.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Mar 2022 13:35:50 -0700 (PDT) From: Jakob Koschel To: Harald Freudenberger Cc: Jakob Koschel , linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Mike Rapoport , "Brian Johannesmeyer" , Cristiano Giuffrida , "Bos, H.J." Subject: [PATCH] s390/zcrypt: fix using the correct variable for sizeof() Date: Sat, 19 Mar 2022 21:35:28 +0100 Message-Id: <20220319203528.2552869-1-jakobkoschel@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While the original code is valid, it is not the obvious choice for the sizeof() call and in preparation to limit the scope of the list iterator variable the sizeof should be changed to the size of the variable being allocated. Signed-off-by: Jakob Koschel --- drivers/s390/crypto/zcrypt_card.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/s390/crypto/zcrypt_card.c b/drivers/s390/crypto/zcrypt_card.c index 3e259befd30a..fcbd537530e8 100644 --- a/drivers/s390/crypto/zcrypt_card.c +++ b/drivers/s390/crypto/zcrypt_card.c @@ -90,7 +90,7 @@ static ssize_t online_store(struct device *dev, list_for_each_entry(zq, &zc->zqueues, list) maxzqs++; if (maxzqs > 0) - zq_uelist = kcalloc(maxzqs + 1, sizeof(zq), GFP_ATOMIC); + zq_uelist = kcalloc(maxzqs + 1, sizeof(*zq_uelist), GFP_ATOMIC); list_for_each_entry(zq, &zc->zqueues, list) if (zcrypt_queue_force_online(zq, online)) if (zq_uelist) { base-commit: 34e047aa16c0123bbae8e2f6df33e5ecc1f56601 -- 2.25.1