public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: zhengyongjun <zhengyongjun3@huawei.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"frankja@linux.ibm.com" <frankja@linux.ibm.com>,
	"david@redhat.com" <david@redhat.com>,
	"imbrenda@linux.ibm.com" <imbrenda@linux.ibm.com>,
	"hca@linux.ibm.com" <hca@linux.ibm.com>,
	"gor@linux.ibm.com" <gor@linux.ibm.com>
Subject: 答复: [PATCH -next] KVM: s390: Return the correct errno code
Date: Thu, 4 Feb 2021 09:04:53 +0000	[thread overview]
Message-ID: <e6926214bd4048ec93f9ad13f83205d3@huawei.com> (raw)
In-Reply-To: <267785c5-527d-3294-cc7e-670d49d87082@de.ibm.com>

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.

      reply	other threads:[~2021-02-04  9:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e6926214bd4048ec93f9ad13f83205d3@huawei.com \
    --to=zhengyongjun3@huawei.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox