upm: Fix 'may be used uninitialized' errors
PATCH 1/3 upm: Fix 'may be used uninitialized' errors
Signed-off-by Khem Raj <[email protected]>
--- ...nitialize-local-variables-before-use.patch | 57 +++++++++++++++++++ meta-oe/recipes-extended/upm/upm_git.bb | 1 + 2 files changed, 58 insertions(+) create mode 100644 meta-oe/recipes-extended/upm/upm/0001-initialize-local-variables-before-use.patch
meta-oe/recipes-extended/upm/upm/0001-initialize-local-variables-before-use.patch new file +57 -0
@@ -0,0 +1,57 @@ +From cce8be3966b602cf7e20d559e50fcf493b9b42cc Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Mon, 23 Dec 2019 18:13:21 -0800 +Subject: [PATCH] initialize local variables before use + +fixes +error: 'ctrl_reg2_data' may be used uninitialized in this function [-Werror=maybe-uninitialized] + +Upstream-Status: Submitted [https://github.com/eclipse/upm/pull/693] +Signed-off-by: Khem Raj <[email protected]> +--- + src/kxtj3/kxtj3.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/kxtj3/kxtj3.c b/src/kxtj3/kxtj3.c +index a6f3c4f8..050ae585 100755 +--- a/src/kxtj3/kxtj3.c ++++ b/src/kxtj3/kxtj3.c +@@ -715,7 +715,7 @@ upm_result_t kxtj3_sensor_software_reset(const kxtj3_context dev) + if (kxtj3_set_bit_on(dev, KXTJ3_CTRL_REG2, KXTJ3_CTRL_REG2_SRST) != UPM_SUCCESS) + return UPM_ERROR_OPERATION_FAILED; + +- uint8_t ctrl_reg2_data; ++ uint8_t ctrl_reg2_data = 0; + kxtj3_read_register(dev, KXTJ3_CTRL_REG2, &ctrl_reg2_data); + + uint8_t srst_counter = 0; +@@ -824,7 +824,7 @@ upm_result_t kxtj3_enable_interrupt_pin(const kxtj3_context dev, KXTJ3_INTERRUPT + KXTJ3_INTERRUPT_RESPONSE_T response_type) + { + assert(dev != NULL); +- uint8_t int_reg_value; ++ uint8_t int_reg_value = 0; + kxtj3_read_register(dev, KXTJ3_INT_CTRL_REG1, &int_reg_value); + + if (polarity) +@@ -865,7 +865,7 @@ upm_result_t kxtj3_set_interrupt_response(const kxtj3_context dev, KXTJ3_INTERRU + bool kxtj3_get_interrupt_status(const kxtj3_context dev) + { + assert(dev != NULL); +- uint8_t status_reg_value; ++ uint8_t status_reg_value = 0; + kxtj3_read_register(dev, KXTJ3_STATUS_REG, &status_reg_value); + if (!(status_reg_value & KXTJ3_STATUS_REG_INT)) + return false; +@@ -955,7 +955,7 @@ kxtj3_wakeup_axes kxtj3_get_wakeup_axis_and_direction(kxtj3_context dev) + { + assert(dev != NULL); + +- uint8_t int_source2_value; ++ uint8_t int_source2_value = 0; + kxtj3_read_register(dev, KXTJ3_INT_SOURCE2, &int_source2_value); + + kxtj3_wakeup_axes wakeup_axis; +-- +2.24.1 +
meta-oe/recipes-extended/upm/upm_git.bb +1 -0
@@ -13,6 +13,7 @@ PV = "2.0.0+git${SRCPV}" SRC_URI = "git://github.com/intel-iot-devkit/${BPN}.git;protocol=http \ file://0001-CMakeLists.txt-Use-SWIG_SUPPORT_FILES-to-find-the-li.patch \ file://0001-Use-stdint-types.patch \ + file://0001-initialize-local-variables-before-use.patch \ " SRC_URI_append_toolchain-clang_x86 = " file://0001-nmea_gps-Link-with-latomic.patch "
Signature · 1 line
2.24.1
PATCH 2/3 memcached: upgrade to 1.5.20
Signed-off-by Khem Raj <[email protected]>
---
.../memcached/{memcached_1.5.10.bb => memcached_1.5.20.bb} | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename meta-networking/recipes-support/memcached/{memcached_1.5.10.bb => memcached_1.5.20.bb} (92%)meta-networking/recipes-support/memcached/memcached_1.5.20.bb renamed from meta-networking/recipes-support/memcached/memcached_1.5.10.bb +2 -2
@@ -22,8 +22,8 @@ RDEPENDS_${PN} += "perl perl-module-posix perl-module-autoloader \ SRC_URI = "http://www.memcached.org/files/${BP}.tar.gz \ file://memcached-add-hugetlbfs-check.patch \ " -SRC_URI[md5sum] = "8462616b554183a75845b03c56837cca" -SRC_URI[sha256sum] = "494c060dbd96d546c74ab85a3cc3984d009b4423767ac33e05dd2340c01f1c4b" +SRC_URI[md5sum] = "4b64296ea0eeccdee9168c035e0488ab" +SRC_URI[sha256sum] = "cfd7b023a9cefe7ae8a67184f51d841dbbf97994ed0e8a55e31ee092320ea1e4" # set the same COMPATIBLE_HOST as libhugetlbfs COMPATIBLE_HOST = '(i.86|x86_64|powerpc|powerpc64|arm).*-linux'
Signature · 1 line
2.24.1
PATCH 3/3 ltrace: Fix build with gcc10
In reply to Khem RajSigned-off-by Khem Raj <[email protected]>
--- ...-struct-pointers-are-null-initilized.patch | 46 +++++++++++++++++++ ...hook-Do-not-append-int-to-std-string.patch | 2 +- meta-oe/recipes-devtools/ltrace/ltrace_git.bb | 1 + 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 meta-oe/recipes-devtools/ltrace/ltrace/0001-ensure-the-struct-pointers-are-null-initilized.patch
meta-oe/recipes-devtools/ltrace/ltrace/0001-ensure-the-struct-pointers-are-null-initilized.patch new file +46 -0
@@ -0,0 +1,46 @@ +From 67a8fa478a4484bc4dbfb3ac74e11be1dd5af594 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Mon, 23 Dec 2019 19:35:48 -0800 +Subject: [PATCH] ensure the struct pointers are null initilized + +Do not delete if pointer is already null + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <[email protected]> +--- + expr.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/expr.c b/expr.c +index 4059a32..5ffd0ad 100644 +--- a/expr.c ++++ b/expr.c +@@ -189,10 +189,8 @@ int + expr_clone(struct expr_node *retp, const struct expr_node *node) + { + *retp = *node; +- ++ struct expr_node *nlhs = 0, *nrhs = 0; + switch (node->kind) { +- struct expr_node *nlhs; +- struct expr_node *nrhs; + + case EXPR_OP_ARGNO: + case EXPR_OP_SELF: +@@ -236,8 +234,10 @@ expr_clone(struct expr_node *retp, const struct expr_node *node) + if (expr_alloc_and_clone(&nlhs, node->lhs, node->own_lhs) < 0) { + if (node->kind == EXPR_OP_CALL2 + && node->u.call.own_rhs) { +- expr_destroy(nrhs); +- free(nrhs); ++ if (nrhs) { ++ expr_destroy(nrhs); ++ free(nrhs); ++ } + return -1; + } + } +-- +2.24.1 +
meta-oe/recipes-devtools/ltrace/ltrace/0001-hook-Do-not-append-int-to-std-string.patch +1 -1
@@ -23,7 +23,7 @@ Signed-off-by: Khem Raj <[email protected]> if (sysconfdir != NULL && *sysconfdir != '\0') { /* No +1, we skip the initial period. */ - syspath = malloc(strlen(sysconfdir) + sizeof FN); -+ syspath = malloc(strlen(sysconfdir) + sizeof FN + 1); ++ syspath = malloc(strlen(sysconfdir) + sizeof FN + 2); + syspath[strlen(sysconfdir) + sizeof FN + 1] = '\0'; if (syspath == NULL - || sprintf(syspath, "%s/%s", sysconfdir, FN + 1) < 0)
meta-oe/recipes-devtools/ltrace/ltrace_git.bb +1 -0
@@ -28,6 +28,7 @@ SRC_URI = "git://github.com/sparkleholic/ltrace.git;branch=master;protocol=http file://0001-hook-Do-not-append-int-to-std-string.patch \ file://include_unistd_nr.patch \ file://0001-Bug-fix-for-data-type-length-judgment.patch \ + file://0001-ensure-the-struct-pointers-are-null-initilized.patch \ " S = "${WORKDIR}/git"
Signature · 1 line
2.24.1