* [PATCH] s390/zcrypt: fix using the correct variable for sizeof()
@ 2022-03-19 20:35 Jakob Koschel
[not found] ` <63552021dab7bcf6385526c6dd715e4f@imap.linux.ibm.com>
0 siblings, 1 reply; 3+ messages in thread
From: Jakob Koschel @ 2022-03-19 20:35 UTC (permalink / raw)
To: Harald Freudenberger
Cc: Jakob Koschel, linux-kernel, linux-s390, Heiko Carstens,
Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
Sven Schnelle, Mike Rapoport, Brian Johannesmeyer,
Cristiano Giuffrida, Bos, H.J.
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>
---
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] s390/zcrypt: fix using the correct variable for sizeof()
[not found] ` <63552021dab7bcf6385526c6dd715e4f@imap.linux.ibm.com>
@ 2022-03-21 12:16 ` Jakob Koschel
2022-03-21 12:28 ` Greg Kroah-Hartman
0 siblings, 1 reply; 3+ messages in thread
From: Jakob Koschel @ 2022-03-21 12:16 UTC (permalink / raw)
To: hfreude
Cc: Heiko Carstens, Vasily Gorbik, Harald Freudenberger,
Linux Kernel Mailing List, linux-s390, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Mike Rapoport,
Brian Johannesmeyer, Cristiano Giuffrida, Bos, H.J.,
Greg Kroah-Hartman
> On 21. Mar 2022, at 10:26, hfreude <hfreude@imap.linux.ibm.com> wrote:
>
> On 2022-03-19 21:35, Jakob Koschel wrote:
>> 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>
>> ---
>> 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
> Thanks Jakob, add my Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
> Which way is this patch going to be integrated into the kernel ?
> Usually I pick this and push it into s390 and on the next merge window it will
> get merged into Linus Torvalds kernel tree.
> However, sounds like you are about to clean up the kernel in preparation for the
> changes related to the double linked list api. So maybe you have a patch series
> which will go into the kernel by another way ?
> Waiting for an answer, Thanks
>
CC'd Greg KH (in case he has some input) but my assumption is that this just goes
the normal way through your s390 tree. Most of this cleanup is not in a hurry so
getting it into the next merge window should be fine.
Jakob
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] s390/zcrypt: fix using the correct variable for sizeof()
2022-03-21 12:16 ` Jakob Koschel
@ 2022-03-21 12:28 ` Greg Kroah-Hartman
0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2022-03-21 12:28 UTC (permalink / raw)
To: Jakob Koschel
Cc: hfreude, Heiko Carstens, Vasily Gorbik, Harald Freudenberger,
Linux Kernel Mailing List, linux-s390, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Mike Rapoport,
Brian Johannesmeyer, Cristiano Giuffrida, Bos, H.J.
On Mon, Mar 21, 2022 at 01:16:52PM +0100, Jakob Koschel wrote:
>
> > On 21. Mar 2022, at 10:26, hfreude <hfreude@imap.linux.ibm.com> wrote:
> >
> > On 2022-03-19 21:35, Jakob Koschel wrote:
> >> 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>
> >> ---
> >> 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
> > Thanks Jakob, add my Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
> > Which way is this patch going to be integrated into the kernel ?
> > Usually I pick this and push it into s390 and on the next merge window it will
> > get merged into Linus Torvalds kernel tree.
> > However, sounds like you are about to clean up the kernel in preparation for the
> > changes related to the double linked list api. So maybe you have a patch series
> > which will go into the kernel by another way ?
> > Waiting for an answer, Thanks
> >
>
> CC'd Greg KH (in case he has some input) but my assumption is that this just goes
> the normal way through your s390 tree. Most of this cleanup is not in a hurry so
> getting it into the next merge window should be fine.
Normal way is fine.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-03-21 12:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-19 20:35 [PATCH] s390/zcrypt: fix using the correct variable for sizeof() Jakob Koschel
[not found] ` <63552021dab7bcf6385526c6dd715e4f@imap.linux.ibm.com>
2022-03-21 12:16 ` Jakob Koschel
2022-03-21 12:28 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®