From 72c6f939c9130328045bda1c8896e078b75f07f0 Mon Sep 17 00:00:00 2001 From: Dexuan Cui Date: Fri, 30 Dec 2011 15:34:35 +0800 Subject: libpciaccess: upgrade from 0.12.1 to 0.12.902 According to http://cgit.freedesktop.org/xorg/lib/libpciaccess/log/, 0.12.902 does fix some bugs, so let's upgrade to it. Moreover, I pulled a patch from upstream git repo. I also updated the COPYING's chksum since there is a minor change to the Copyright header. Signed-off-by: Dexuan Cui --- .../fix_deletion_of_last_handle.patch | 51 ++++++++++++++++++++++ .../xorg-lib/libpciaccess_0.12.1.bb | 16 ------- .../xorg-lib/libpciaccess_0.12.902.bb | 18 ++++++++ 3 files changed, 69 insertions(+), 16 deletions(-) create mode 100644 meta/recipes-graphics/xorg-lib/libpciaccess-0.12.902/fix_deletion_of_last_handle.patch delete mode 100644 meta/recipes-graphics/xorg-lib/libpciaccess_0.12.1.bb create mode 100644 meta/recipes-graphics/xorg-lib/libpciaccess_0.12.902.bb diff --git a/meta/recipes-graphics/xorg-lib/libpciaccess-0.12.902/fix_deletion_of_last_handle.patch b/meta/recipes-graphics/xorg-lib/libpciaccess-0.12.902/fix_deletion_of_last_handle.patch new file mode 100644 index 000000000..1933f4549 --- /dev/null +++ b/meta/recipes-graphics/xorg-lib/libpciaccess-0.12.902/fix_deletion_of_last_handle.patch @@ -0,0 +1,51 @@ +Upstream-Status: Backport + +The below patch is from +http://cgit.freedesktop.org/xorg/lib/libpciaccess/commit/?id=a798395a1bfd9d06d40e2d8d14377a156c94429a +It would appear in the next .tar.bz2 release. + +------------------------------ + +commit a798395a1bfd9d06d40e2d8d14377a156c94429a +Author: Daniel Drake +Date: Fri Nov 25 12:28:48 2011 -0600 + + delete_io_handle: fix deletion of last handle + + When num_ios goes from 1 to 0, a realloc(ios, 0); call is made. + This is equivalent to free(ios) and NULL is returned. + + However, the previous logic in the code incorrectly discards this NULL + return value. When we next call new_io_handle(), realloc(ios, X) is + called with "ios" pointing to freed memory. This causes glibc to abort. + + Correct this logic to detect the 1-to-0 case and handle it correctly. + Other cases are unchanged; there is still value in checking the + return value from realloc() as it also returns NULL on error. + + Signed-off-by: Daniel Drake + Reviewed-by: Alan Coopersmith + +diff --git a/src/common_io.c b/src/common_io.c +index f1319f8..5b35e07 100644 +--- a/src/common_io.c ++++ b/src/common_io.c +@@ -64,10 +64,15 @@ delete_io_handle(struct pci_io_handle *handle) + } + } + +- new = realloc(ios, sizeof(struct pci_io_handle) * (num_ios - 1)); +- if (new) +- ios = new; + num_ios--; ++ if (num_ios) { ++ new = realloc(ios, sizeof(struct pci_io_handle) * num_ios); ++ if (new) ++ ios = new; ++ } else { ++ free(ios); ++ ios = NULL; ++ } + } + + _pci_hidden void diff --git a/meta/recipes-graphics/xorg-lib/libpciaccess_0.12.1.bb b/meta/recipes-graphics/xorg-lib/libpciaccess_0.12.1.bb deleted file mode 100644 index b3091fd7c..000000000 --- a/meta/recipes-graphics/xorg-lib/libpciaccess_0.12.1.bb +++ /dev/null @@ -1,16 +0,0 @@ -SUMMARY = "Generic PCI access library for X" - -DESCRIPTION = "libpciaccess provides functionality for X to access the \ -PCI bus and devices in a platform-independant way." - -require xorg-lib-common.inc - -LICENSE = "MIT & MIT-style" -LIC_FILES_CHKSUM = "file://COPYING;md5=2c765efe1e0722c1badff5e54429b102" - -PR = "r0" - -DEPENDS += "xproto virtual/libx11" - -SRC_URI[md5sum] = "d6363ee9f4df79f6fc47cba7c67b0d35" -SRC_URI[sha256sum] = "cc47d7f0e48cf4eed972916b536fdc97788d7521915e3ae1cc92d540776d7344" diff --git a/meta/recipes-graphics/xorg-lib/libpciaccess_0.12.902.bb b/meta/recipes-graphics/xorg-lib/libpciaccess_0.12.902.bb new file mode 100644 index 000000000..5043634fd --- /dev/null +++ b/meta/recipes-graphics/xorg-lib/libpciaccess_0.12.902.bb @@ -0,0 +1,18 @@ +SUMMARY = "Generic PCI access library for X" + +DESCRIPTION = "libpciaccess provides functionality for X to access the \ +PCI bus and devices in a platform-independant way." + +require xorg-lib-common.inc + +SRC_URI += "file://fix_deletion_of_last_handle.patch" + +LICENSE = "MIT & MIT-style" +LIC_FILES_CHKSUM = "file://COPYING;md5=de01cb89a769dc657d4c321c209ce4fc" + +PR = "r0" + +DEPENDS += "xproto virtual/libx11" + +SRC_URI[md5sum] = "f1db198398a8a1143822acc230843e8c" +SRC_URI[sha256sum] = "0861d5bf68b598baa307e5c9b06dfd38ae03096b46e36b236106517bcd14b63a" -- cgit v1.2.3