You need to sign in or sign up before continuing.
提交 97f32e11 编写于 作者: J Jakob Koschel 提交者: Vasily Gorbik

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: NJakob Koschel <jakobkoschel@gmail.com>
Signed-off-by: NHarald Freudenberger <freude@linux.ibm.com>
Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
上级 71078220
...@@ -90,7 +90,7 @@ static ssize_t online_store(struct device *dev, ...@@ -90,7 +90,7 @@ static ssize_t online_store(struct device *dev,
list_for_each_entry(zq, &zc->zqueues, list) list_for_each_entry(zq, &zc->zqueues, list)
maxzqs++; maxzqs++;
if (maxzqs > 0) 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) list_for_each_entry(zq, &zc->zqueues, list)
if (zcrypt_queue_force_online(zq, online)) if (zcrypt_queue_force_online(zq, online))
if (zq_uelist) { if (zq_uelist) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册