linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: Jens Axboe <axboe@kernel.dk>,
	josh.h.morris@us.ibm.com, pjk1939@linux.ibm.com
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] block: rsxx: fix error return code of rsxx_pci_probe()
Date: Wed, 10 Mar 2021 09:13:43 +0800	[thread overview]
Message-ID: <0a0a6160-f469-9be8-a9e2-3067c02f0b57@gmail.com> (raw)
In-Reply-To: <cf2dd66c-0e1e-944e-f4c5-542095f6c9d7@kernel.dk>



On 2021/3/10 4:59, Jens Axboe wrote:
> On 3/8/21 3:05 AM, Jia-Ju Bai wrote:
>> Some error handling segments of rsxx_pci_probe() do not return error code,
>> so add error code for these segments.
>>
>> Fixes: 8722ff8cdbfa ("block: IBM RamSan 70/80 device driver")
>> Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
>> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
>> ---
>>   drivers/block/rsxx/core.c | 18 +++++++++++++++---
>>   1 file changed, 15 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/block/rsxx/core.c b/drivers/block/rsxx/core.c
>> index 63f549889f87..6b3b9b31a3e8 100644
>> --- a/drivers/block/rsxx/core.c
>> +++ b/drivers/block/rsxx/core.c
>> @@ -760,13 +760,17 @@ static int rsxx_pci_probe(struct pci_dev *dev,
>>   	pci_set_drvdata(dev, card);
>>   
>>   	st = ida_alloc(&rsxx_disk_ida, GFP_KERNEL);
>> -	if (st < 0)
>> +	if (st < 0) {
>> +		st = -ENOMEM;
>>   		goto failed_ida_get;
>> +	}
>>   	card->disk_id = st;
>>   
>>   	st = pci_enable_device(dev);
>> -	if (st)
>> +	if (st) {
>> +		st = -EIO;
>>   		goto failed_enable;
>> +	}
>>   
>>   	pci_set_master(dev);
> Maybe there are some valid parts to the patch, but the two above at
> least make no sense - we're returning the error here as passed from
> ida_alloc or pci_enable_device, why are you overriding them?
>

Ah, sorry for these incorrect parts...
I will send a new patch.


Best wishes,
Jia-Ju Bai

      reply	other threads:[~2021-03-10  1:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08 10:05 [PATCH] block: rsxx: fix error return code of rsxx_pci_probe() Jia-Ju Bai
2021-03-09 20:59 ` Jens Axboe
2021-03-10  1:13   ` Jia-Ju Bai [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=0a0a6160-f469-9be8-a9e2-3067c02f0b57@gmail.com \
    --to=baijiaju1990@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=josh.h.morris@us.ibm.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pjk1939@linux.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).