Re: [PATCH] tg3: fix return value check in tg3_read_vpd()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Sterba
Date: Wednesday, December 29, 2010 - 6:17 am

Hi,

On Monday 27 December 2010 21:19:27 Dan Carpenter wrote:

Although pci_read_vpd returns ENODEV directly, there is a call to vpd->read
function which may return other error values and is eg. set to
pci_vpd_pci22_read() :

drivers/pci/access.c::pci_vpd_pci22_read()
  may return -EINVAL or -EINTR directly
  or -ETIMEDOUT or -EINTR via pci_vpd_pci22_wait()

Yes, other negative values besides ETIMEDOUT and EINTR are ignored and after
3 attempts the pos != TG3_NVM_VPD_LEN check goes outwards. The fixed version
allows to jump out immediately. So this does not manifest itself as a 
misbehaviour at runtime. It was found by code analysis.

I'll post updated patch.

dave
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] tg3: fix return value check in tg3_read_vpd(), David Sterba, (Mon Dec 27, 10:31 am)
Re: [PATCH] tg3: fix return value check in tg3_read_vpd(), Dan Carpenter, (Mon Dec 27, 1:19 pm)
Re: [PATCH] tg3: fix return value check in tg3_read_vpd(), David Sterba, (Wed Dec 29, 6:17 am)