pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/parallel/pocl pocl: Fix a null pointer dererence if sy...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6c64494f0132
branches:  trunk
changeset: 454386:6c64494f0132
user:      nia <nia%pkgsrc.org@localhost>
date:      Thu Jun 10 11:18:06 2021 +0000

description:
pocl: Fix a null pointer dererence if sysfs is not present *sigh*

diffstat:

 parallel/pocl/Makefile                               |   4 +-
 parallel/pocl/distinfo                               |   3 +-
 parallel/pocl/patches/patch-lib_CL_devices_cpuinfo.c |  22 ++++++++++++++++++++
 3 files changed, 26 insertions(+), 3 deletions(-)

diffs (56 lines):

diff -r ecdee247ec5d -r 6c64494f0132 parallel/pocl/Makefile
--- a/parallel/pocl/Makefile    Thu Jun 10 11:06:19 2021 +0000
+++ b/parallel/pocl/Makefile    Thu Jun 10 11:18:06 2021 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.2 2021/06/10 10:26:32 nia Exp $
+# $NetBSD: Makefile,v 1.3 2021/06/10 11:18:06 nia Exp $
 
 DISTNAME=      pocl-1.7
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    parallel
 MASTER_SITES=  http://portablecl.org/downloads/
 
diff -r ecdee247ec5d -r 6c64494f0132 parallel/pocl/distinfo
--- a/parallel/pocl/distinfo    Thu Jun 10 11:06:19 2021 +0000
+++ b/parallel/pocl/distinfo    Thu Jun 10 11:18:06 2021 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.1 2021/06/10 09:57:40 nia Exp $
+$NetBSD: distinfo,v 1.2 2021/06/10 11:18:06 nia Exp $
 
 SHA1 (pocl-1.7.tar.gz) = 7f28546ac51d89ba699cc5adce1ddf2e91bdf230
 RMD160 (pocl-1.7.tar.gz) = 75555c802bf133298d615f5c146174dc0f959a72
@@ -8,6 +8,7 @@
 SHA1 (patch-config.h.in.cmake) = 974fad1f19516ef0b73f7db5b3948e677f4aaf98
 SHA1 (patch-lib_CL_devices_basic_basic.c) = 9110d868a305cefc2e19fd7d7482f6ce2b8a6164
 SHA1 (patch-lib_CL_devices_common.c) = c276aa967a1cc79b2bd6029b287b887bdb2b0010
+SHA1 (patch-lib_CL_devices_cpuinfo.c) = 70c4948c4948134e05d165ca0e8f6bd6fa68754b
 SHA1 (patch-lib_CL_devices_devices.c) = 17a5bb001086befdf88452b7e1126d2f5f4b1fc1
 SHA1 (patch-lib_CL_devices_hsa_pocl-hsa.c) = b7b4798b6f47f4d60a914f45ba64fe8448accdb9
 SHA1 (patch-lib_CL_devices_pthread_pthread.c) = afc0ab5544300d141d1fbfe5b7fe18af281365fa
diff -r ecdee247ec5d -r 6c64494f0132 parallel/pocl/patches/patch-lib_CL_devices_cpuinfo.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/parallel/pocl/patches/patch-lib_CL_devices_cpuinfo.c      Thu Jun 10 11:18:06 2021 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-lib_CL_devices_cpuinfo.c,v 1.1 2021/06/10 11:18:06 nia Exp $
+
+Do not segfault if /sys/bus/pci/devices/0000:00:00.0/vendor does not exist.
+
+--- lib/CL/devices/cpuinfo.c.orig      2021-05-19 08:12:19.000000000 +0000
++++ lib/CL/devices/cpuinfo.c
+@@ -416,9 +416,12 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_
+   if (!device->vendor_id)
+     {
+       f = fopen (pci_bus_root_vendor_file, "r");
+-      num_read = fscanf (f, "%x", &device->vendor_id);
+-      fclose (f);
+-      /* no error checking, if it failed we just won't have the info */
++      if (f)
++        {
++          /* no error checking, if it failed we just won't have the info */
++          num_read = fscanf (f, "%x", &device->vendor_id);
++          fclose (f);
++        }
+     }
+ }
+ 



Home | Main Index | Thread Index | Old Index