Skip to content

Commit 97f32e1

Browse files
Jakob-KoschelVasily Gorbik
authored andcommitted
s390/zcrypt: fix using the correct variable for sizeof()
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 <jakobkoschel@gmail.com> Signed-off-by: Harald Freudenberger <freude@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
1 parent 7107822 commit 97f32e1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/s390/crypto/zcrypt_card.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static ssize_t online_store(struct device *dev,
9090
list_for_each_entry(zq, &zc->zqueues, list)
9191
maxzqs++;
9292
if (maxzqs > 0)
93-
zq_uelist = kcalloc(maxzqs + 1, sizeof(zq), GFP_ATOMIC);
93+
zq_uelist = kcalloc(maxzqs + 1, sizeof(*zq_uelist), GFP_ATOMIC);
9494
list_for_each_entry(zq, &zc->zqueues, list)
9595
if (zcrypt_queue_force_online(zq, online))
9696
if (zq_uelist) {

0 commit comments

Comments
 (0)