Bug#686153: [PATCH] int10: fix pci_device_read_rom usage

2012-09-30 Thread Julien Cristau
Keith, could you pick up this patch?

Thanks,
Julien

On Wed, Aug 29, 2012 at 20:03:58 +0200, Julien Cristau wrote:

 From: Stephan Schreiber i...@fs-driver.org
 
 I noticed that the build-in int10 driver always reports
 Unable to retrieve all of segment 0x0C.
 even though the entire BIOS data is retrieved with success.
 
 The associated code is in hw/xfree86/int10/generic.c, in the function
 xf86ExtendedInitInt10():
 
 if (pci_device_read_rom(pInt-dev, vbiosMem)  V_BIOS_SIZE) {
 xf86DrvMsg(screen, X_WARNING,
Unable to retrieve all of segment 0x0C.\n);
 }
 
 The function pci_device_read_rom() is from libpciaccess; its return
 value is not a size but an error status code: 0 means success.
 If pci_device_read_rom() returns 0 for success, the warning is generated.
 
 The proposed patch corrects the evaluation of the return value of
 pci_device_read_rom() and of the supplied BIOS size.
 
 Debian bug#686153
 
 Signed-off-by: Julien Cristau jcris...@debian.org
 ---
  hw/xfree86/int10/generic.c |3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c
 index 4633120..d7594de 100644
 --- a/hw/xfree86/int10/generic.c
 +++ b/hw/xfree86/int10/generic.c
 @@ -178,7 +178,8 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
   */
  vbiosMem = (char *) base + V_BIOS;
  memset(vbiosMem, 0, 2 * V_BIOS_SIZE);
 -if (pci_device_read_rom(pInt-dev, vbiosMem)  V_BIOS_SIZE) {
 +if (pci_device_read_rom(pInt-dev, vbiosMem) != 0
 +|| pInt-dev-rom_size  V_BIOS_SIZE) {
  xf86DrvMsg(pScrn-scrnIndex, X_WARNING,
 Unable to retrieve all of segment 0x0C.\n);
  }
 -- 
 1.7.10.4


signature.asc
Description: Digital signature


Bug#686153: [PATCH] int10: fix pci_device_read_rom usage

2012-08-30 Thread Dave Airlie
On Thu, Aug 30, 2012 at 4:03 AM, Julien Cristau jcris...@debian.org wrote:
 From: Stephan Schreiber i...@fs-driver.org

 I noticed that the build-in int10 driver always reports
 Unable to retrieve all of segment 0x0C.
 even though the entire BIOS data is retrieved with success.

 The associated code is in hw/xfree86/int10/generic.c, in the function
 xf86ExtendedInitInt10():

 if (pci_device_read_rom(pInt-dev, vbiosMem)  V_BIOS_SIZE) {
 xf86DrvMsg(screen, X_WARNING,
Unable to retrieve all of segment 0x0C.\n);
 }

 The function pci_device_read_rom() is from libpciaccess; its return
 value is not a size but an error status code: 0 means success.
 If pci_device_read_rom() returns 0 for success, the warning is generated.

 The proposed patch corrects the evaluation of the return value of
 pci_device_read_rom() and of the supplied BIOS size.

 Debian bug#686153

 Signed-off-by: Julien Cristau jcris...@debian.org

Reviewed-by: Dave Airlie airl...@redhat.com
 ---
  hw/xfree86/int10/generic.c |3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

 diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c
 index 4633120..d7594de 100644
 --- a/hw/xfree86/int10/generic.c
 +++ b/hw/xfree86/int10/generic.c
 @@ -178,7 +178,8 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
   */
  vbiosMem = (char *) base + V_BIOS;
  memset(vbiosMem, 0, 2 * V_BIOS_SIZE);
 -if (pci_device_read_rom(pInt-dev, vbiosMem)  V_BIOS_SIZE) {
 +if (pci_device_read_rom(pInt-dev, vbiosMem) != 0
 +|| pInt-dev-rom_size  V_BIOS_SIZE) {
  xf86DrvMsg(pScrn-scrnIndex, X_WARNING,
 Unable to retrieve all of segment 0x0C.\n);
  }
 --
 1.7.10.4

 ___
 xorg-de...@lists.x.org: X.Org development
 Archives: http://lists.x.org/archives/xorg-devel
 Info: http://lists.x.org/mailman/listinfo/xorg-devel


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#686153: [PATCH] int10: fix pci_device_read_rom usage

2012-08-29 Thread Julien Cristau
From: Stephan Schreiber i...@fs-driver.org

I noticed that the build-in int10 driver always reports
Unable to retrieve all of segment 0x0C.
even though the entire BIOS data is retrieved with success.

The associated code is in hw/xfree86/int10/generic.c, in the function
xf86ExtendedInitInt10():

if (pci_device_read_rom(pInt-dev, vbiosMem)  V_BIOS_SIZE) {
xf86DrvMsg(screen, X_WARNING,
   Unable to retrieve all of segment 0x0C.\n);
}

The function pci_device_read_rom() is from libpciaccess; its return
value is not a size but an error status code: 0 means success.
If pci_device_read_rom() returns 0 for success, the warning is generated.

The proposed patch corrects the evaluation of the return value of
pci_device_read_rom() and of the supplied BIOS size.

Debian bug#686153

Signed-off-by: Julien Cristau jcris...@debian.org
---
 hw/xfree86/int10/generic.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c
index 4633120..d7594de 100644
--- a/hw/xfree86/int10/generic.c
+++ b/hw/xfree86/int10/generic.c
@@ -178,7 +178,8 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
  */
 vbiosMem = (char *) base + V_BIOS;
 memset(vbiosMem, 0, 2 * V_BIOS_SIZE);
-if (pci_device_read_rom(pInt-dev, vbiosMem)  V_BIOS_SIZE) {
+if (pci_device_read_rom(pInt-dev, vbiosMem) != 0
+|| pInt-dev-rom_size  V_BIOS_SIZE) {
 xf86DrvMsg(pScrn-scrnIndex, X_WARNING,
Unable to retrieve all of segment 0x0C.\n);
 }
-- 
1.7.10.4


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org