From 5d5268b8faa2f9143bc68b814f3b9de6179f9b42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Wed, 24 Mar 2021 16:35:59 -0300 Subject: [PATCH] RyzenAdj: fix segfault on musl. --- .../RyzenAdj/patches/heap-corruption.patch | 36 +++++++++++++++++++ srcpkgs/RyzenAdj/template | 3 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/RyzenAdj/patches/heap-corruption.patch diff --git a/srcpkgs/RyzenAdj/patches/heap-corruption.patch b/srcpkgs/RyzenAdj/patches/heap-corruption.patch new file mode 100644 index 00000000000..6b8fc81267f --- /dev/null +++ b/srcpkgs/RyzenAdj/patches/heap-corruption.patch @@ -0,0 +1,36 @@ +From 6efee1997c468150f472941f0f183fc054b436a4 Mon Sep 17 00:00:00 2001 +From: unknown +Date: Sat, 27 Feb 2021 01:26:18 +0100 +Subject: [PATCH] fix Heap corruption + +--- + lib/nb_smu_ops.c | 2 +- + lib/ryzenadj.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/nb_smu_ops.c b/lib/nb_smu_ops.c +index 965264c..2c31b48 100644 +--- a/lib/nb_smu_ops.c ++++ b/lib/nb_smu_ops.c +@@ -45,7 +45,7 @@ smu_t get_smu(nb_t nb, int smu_type) { + uint32_t rep; /* REP of test message */ + smu_service_args_t arg = {0, 0, 0, 0, 0, 0}; /* Test message shuld have no arguments */ + +- smu = (smu_t)malloc((sizeof(smu_t))); ++ smu = (smu_t)malloc((sizeof(*smu))); + smu->nb = nb; + /* Fill SMU information */ + switch(smu_type){ +diff --git a/lib/ryzenadj.h b/lib/ryzenadj.h +index 6f18ade..90c94ee 100644 +--- a/lib/ryzenadj.h ++++ b/lib/ryzenadj.h +@@ -10,7 +10,7 @@ extern "C" { + + #define RYZENADJ_REVISION_VER 0 + #define RYZENADJ_MAJOR_VER 7 +-#define RYZENADJ_MINIOR_VER 0 ++#define RYZENADJ_MINIOR_VER 1 + + enum ryzen_family { + FAM_UNKNOWN = -1, diff --git a/srcpkgs/RyzenAdj/template b/srcpkgs/RyzenAdj/template index fa5a2aa511d..1ceb4fec1e4 100644 --- a/srcpkgs/RyzenAdj/template +++ b/srcpkgs/RyzenAdj/template @@ -1,7 +1,7 @@ # Template file for 'RyzenAdj' pkgname=RyzenAdj version=0.7.0 -revision=1 +revision=2 archs="x86_64*" build_style=cmake makedepends="pciutils-devel" @@ -11,6 +11,7 @@ license="LGPL-3.0-only" homepage="https://github.com/FlyGoat/RyzenAdj" distfiles="https://github.com/FlyGoat/RyzenAdj/archive/v${version}.tar.gz" checksum=fff8a08e657ba35f919bd564fbe2e15e7c615ac6e2a357ffcc3472069e8081f6 +patch_args=-Np1 do_install() { vbin build/ryzenadj