lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-id: <52AEF670.6060108@gmail.com>
Date:	Mon, 16 Dec 2013 14:47:44 +0200
From:	Eli Billauer <eli.billauer@...il.com>
To:	Jingoo Han <jg1.han@...sung.com>
Cc:	'Wei Yongjun' <weiyj.lk@...il.com>, gregkh@...uxfoundation.org,
	yongjun_wei@...ndmicro.com.cn, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] staging: xillybus: fix error return code in
 xilly_probe()

Thanks for reporting this bug. The same bug exists in the driver for OF 
(xillybus_of.c).

As for the choice of -EIO, I've surveyed several drivers calling 
of_iomap() and pci_iomap(), and it turns out that some fail on -ENOMEM, 
some on -EIO and some on -EBUSY.

Personally, I'm inclined towards -ENOMEM, since the problem is a memory 
mapping failure.

I'll submit a patch fixing both files soon.

Thanks again,
    Eli

On 16/12/13 12:06, Jingoo Han wrote:
> On Monday, December 16, 2013 2:51 PM, Wei Yongjun wrote:
>    
>> From: Wei Yongjun<yongjun_wei@...ndmicro.com.cn>
>>
>> Fix to return negative error code -EIO from the error handling
>> case instead of 0.
>>
>> Signed-off-by: Wei Yongjun<yongjun_wei@...ndmicro.com.cn>
>> ---
>>   drivers/staging/xillybus/xillybus_pcie.c | 2 +-
>>      
> It looks good.
> Reviewed-by: Jingoo Han<jg1.han@...sung.com>
>
> Best regards,
> Jingoo Han
>
>    
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/xillybus/xillybus_pcie.c b/drivers/staging/xillybus/xillybus_pcie.c
>> index 0564f97..51426d8 100644
>> --- a/drivers/staging/xillybus/xillybus_pcie.c
>> +++ b/drivers/staging/xillybus/xillybus_pcie.c
>> @@ -168,9 +168,9 @@ static int xilly_probe(struct pci_dev *pdev,
>>   	}
>>
>>   	endpoint->registers = pci_iomap(pdev, 0, 128);
>> -
>>   	if (!endpoint->registers) {
>>   		dev_err(endpoint->dev, "Failed to map BAR 0. Aborting.\n");
>> +		rc = -EIO;
>>   		goto failed_iomap0;
>>   	}
>>
>>      
>    


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ