* [PATCH -next] KVM: s390: Return the correct errno code
@ 2021-02-04 8:05 ` Zheng Yongjun
0 siblings, 0 replies; 6+ messages in thread
From: Zheng Yongjun @ 2021-02-04 8:05 UTC (permalink / raw)
To: kvm, linux-s390, linux-kernel
Cc: borntraeger, frankja, david, cohuck, imbrenda, hca, gor, Zheng Yongjun
When valloc failed, should return ENOMEM rather than ENOBUF.
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
arch/s390/kvm/interrupt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 2f177298c663..6b7acc27cfa2 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -2252,7 +2252,7 @@ static int get_all_floating_irqs(struct kvm *kvm, u8 __user *usrbuf, u64 len)
*/
buf = vzalloc(len);
if (!buf)
- return -ENOBUFS;
+ return -ENOMEM;
max_irqs = len / sizeof(struct kvm_s390_irq);
--
2.22.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH -next] KVM: s390: Return the correct errno code
@ 2021-02-04 8:05 ` Zheng Yongjun
0 siblings, 0 replies; 6+ messages in thread
From: Zheng Yongjun @ 2021-02-04 8:05 UTC (permalink / raw)
To: kvm, linux-s390, linux-kernel
Cc: borntraeger, frankja, david, cohuck, imbrenda, hca, gor, Zheng Yongjun
When valloc failed, should return ENOMEM rather than ENOBUF.
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
arch/s390/kvm/interrupt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 2f177298c663..6b7acc27cfa2 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -2252,7 +2252,7 @@ static int get_all_floating_irqs(struct kvm *kvm, u8 __user *usrbuf, u64 len)
*/
buf = vzalloc(len);
if (!buf)
- return -ENOBUFS;
+ return -ENOMEM;
max_irqs = len / sizeof(struct kvm_s390_irq);
--
2.22.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH -next] KVM: s390: Return the correct errno code
2021-02-04 8:05 ` Zheng Yongjun
@ 2021-02-04 8:32 ` Cornelia Huck
-1 siblings, 0 replies; 6+ messages in thread
From: Cornelia Huck @ 2021-02-04 8:32 UTC (permalink / raw)
To: Zheng Yongjun
Cc: kvm, linux-s390, linux-kernel, borntraeger, frankja, david,
imbrenda, hca, gor
On Thu, 4 Feb 2021 16:05:23 +0800
Zheng Yongjun <zhengyongjun3@huawei.com> wrote:
> When valloc failed, should return ENOMEM rather than ENOBUF.
>
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> ---
> arch/s390/kvm/interrupt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
> index 2f177298c663..6b7acc27cfa2 100644
> --- a/arch/s390/kvm/interrupt.c
> +++ b/arch/s390/kvm/interrupt.c
> @@ -2252,7 +2252,7 @@ static int get_all_floating_irqs(struct kvm *kvm, u8 __user *usrbuf, u64 len)
> */
> buf = vzalloc(len);
> if (!buf)
> - return -ENOBUFS;
> + return -ENOMEM;
>
> max_irqs = len / sizeof(struct kvm_s390_irq);
>
This breaks a user space interface (see the comment right above the
vzalloc).
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] KVM: s390: Return the correct errno code
@ 2021-02-04 8:32 ` Cornelia Huck
0 siblings, 0 replies; 6+ messages in thread
From: Cornelia Huck @ 2021-02-04 8:32 UTC (permalink / raw)
To: Zheng Yongjun
Cc: kvm, linux-s390, linux-kernel, borntraeger, frankja, david,
imbrenda, hca, gor
On Thu, 4 Feb 2021 16:05:23 +0800
Zheng Yongjun <zhengyongjun3@huawei.com> wrote:
> When valloc failed, should return ENOMEM rather than ENOBUF.
>
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> ---
> arch/s390/kvm/interrupt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
> index 2f177298c663..6b7acc27cfa2 100644
> --- a/arch/s390/kvm/interrupt.c
> +++ b/arch/s390/kvm/interrupt.c
> @@ -2252,7 +2252,7 @@ static int get_all_floating_irqs(struct kvm *kvm, u8 __user *usrbuf, u64 len)
> */
> buf = vzalloc(len);
> if (!buf)
> - return -ENOBUFS;
> + return -ENOMEM;
>
> max_irqs = len / sizeof(struct kvm_s390_irq);
>
This breaks a user space interface (see the comment right above the
vzalloc).
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] KVM: s390: Return the correct errno code
2021-02-04 8:32 ` Cornelia Huck
(?)
@ 2021-02-04 8:42 ` Christian Borntraeger
2021-02-04 9:04 ` 答复: " zhengyongjun
-1 siblings, 1 reply; 6+ messages in thread
From: Christian Borntraeger @ 2021-02-04 8:42 UTC (permalink / raw)
To: Cornelia Huck, Zheng Yongjun
Cc: kvm, linux-s390, linux-kernel, frankja, david, imbrenda, hca, gor
On 04.02.21 09:32, Cornelia Huck wrote:
> On Thu, 4 Feb 2021 16:05:23 +0800
> Zheng Yongjun <zhengyongjun3@huawei.com> wrote:
>
>> When valloc failed, should return ENOMEM rather than ENOBUF.
>>
>> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
>> ---
>> arch/s390/kvm/interrupt.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
>> index 2f177298c663..6b7acc27cfa2 100644
>> --- a/arch/s390/kvm/interrupt.c
>> +++ b/arch/s390/kvm/interrupt.c
>> @@ -2252,7 +2252,7 @@ static int get_all_floating_irqs(struct kvm *kvm, u8 __user *usrbuf, u64 len)
>> */
>> buf = vzalloc(len);
>> if (!buf)
>> - return -ENOBUFS;
>> + return -ENOMEM;
>>
>> max_irqs = len / sizeof(struct kvm_s390_irq);
>>
>
> This breaks a user space interface (see the comment right above the
> vzalloc).
Right. Please do not send (generated?) patches without looking at the code
that you are patching.
^ permalink raw reply [flat|nested] 6+ messages in thread
* 答复: [PATCH -next] KVM: s390: Return the correct errno code
2021-02-04 8:42 ` Christian Borntraeger
@ 2021-02-04 9:04 ` zhengyongjun
0 siblings, 0 replies; 6+ messages in thread
From: zhengyongjun @ 2021-02-04 9:04 UTC (permalink / raw)
To: Christian Borntraeger, Cornelia Huck
Cc: kvm, linux-s390, linux-kernel, frankja, david, imbrenda, hca, gor
Thanks for your advice, I will do this better later :)
-----邮件原件-----
发件人: Christian Borntraeger [mailto:borntraeger@de.ibm.com]
发送时间: 2021年2月4日 16:42
收件人: Cornelia Huck <cohuck@redhat.com>; zhengyongjun <zhengyongjun3@huawei.com>
抄送: kvm@vger.kernel.org; linux-s390@vger.kernel.org; linux-kernel@vger.kernel.org; frankja@linux.ibm.com; david@redhat.com; imbrenda@linux.ibm.com; hca@linux.ibm.com; gor@linux.ibm.com
主题: Re: [PATCH -next] KVM: s390: Return the correct errno code
On 04.02.21 09:32, Cornelia Huck wrote:
> On Thu, 4 Feb 2021 16:05:23 +0800
> Zheng Yongjun <zhengyongjun3@huawei.com> wrote:
>
>> When valloc failed, should return ENOMEM rather than ENOBUF.
>>
>> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
>> ---
>> arch/s390/kvm/interrupt.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
>> index 2f177298c663..6b7acc27cfa2 100644
>> --- a/arch/s390/kvm/interrupt.c
>> +++ b/arch/s390/kvm/interrupt.c
>> @@ -2252,7 +2252,7 @@ static int get_all_floating_irqs(struct kvm *kvm, u8 __user *usrbuf, u64 len)
>> */
>> buf = vzalloc(len);
>> if (!buf)
>> - return -ENOBUFS;
>> + return -ENOMEM;
>>
>> max_irqs = len / sizeof(struct kvm_s390_irq);
>>
>
> This breaks a user space interface (see the comment right above the
> vzalloc).
Right. Please do not send (generated?) patches without looking at the code that you are patching.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-02-04 9:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-04 8:05 [PATCH -next] KVM: s390: Return the correct errno code Zheng Yongjun
2021-02-04 8:05 ` Zheng Yongjun
2021-02-04 8:32 ` Cornelia Huck
2021-02-04 8:32 ` Cornelia Huck
2021-02-04 8:42 ` Christian Borntraeger
2021-02-04 9:04 ` 答复: " zhengyongjun
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.