qtserialport: backport patch to silence Valgrind warning
authorJonathan Liu <net147@gmail.com>
Tue, 10 Mar 2015 06:37:12 +0000 (17:37 +1100)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Fri, 24 Jul 2015 16:42:14 +0000 (13:42 -0300)
(From meta-qt5 rev: 1fd5df421ea30ac7f2bd994f58956ce46e90fcec)

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
meta-qt5/recipes-qt/qt5/qtserialport-git/0001-Unix-Clear-serial_struct-instances.patch [new file with mode: 0644]
meta-qt5/recipes-qt/qt5/qtserialport.inc
meta-qt5/recipes-qt/qt5/qtserialport/0001-Unix-Clear-serial_struct-instances.patch [new file with mode: 0644]

diff --git a/meta-qt5/recipes-qt/qt5/qtserialport-git/0001-Unix-Clear-serial_struct-instances.patch b/meta-qt5/recipes-qt/qt5/qtserialport-git/0001-Unix-Clear-serial_struct-instances.patch
new file mode 100644 (file)
index 0000000..b14cf01
--- /dev/null
@@ -0,0 +1,42 @@
+From 53afe73154c7c00b54cd280fa3d6c9127a2bc84b Mon Sep 17 00:00:00 2001
+From: Jonathan Liu <net147@gmail.com>
+Date: Mon, 9 Mar 2015 22:35:56 +1100
+Subject: [PATCH] Unix: Clear serial_struct instances
+
+Silences the following Valgrind warning:
+Conditional jump or move depends on uninitialised value(s)
+
+Upstream-Status: Backport from 5.5 branch
+
+Change-Id: I8fd8cfd6aa6f75ed515e6151cfc282faca508bdc
+Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+---
+ src/serialport/qserialport_unix.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp
+index 34ef41d..7cf356b 100644
+--- a/src/serialport/qserialport_unix.cpp
++++ b/src/serialport/qserialport_unix.cpp
+@@ -439,6 +439,8 @@ QSerialPortPrivate::setStandardBaudRate(qint32 baudRate, QSerialPort::Directions
+ {
+     struct serial_struct currentSerialInfo;
++    ::memset(&currentSerialInfo, 0, sizeof(currentSerialInfo));
++
+     if ((::ioctl(descriptor, TIOCGSERIAL, &currentSerialInfo) != -1)
+             && (currentSerialInfo.flags & ASYNC_SPD_CUST)) {
+         currentSerialInfo.flags &= ~ASYNC_SPD_CUST;
+@@ -469,6 +471,8 @@ QSerialPortPrivate::setCustomBaudRate(qint32 baudRate, QSerialPort::Directions d
+     struct serial_struct currentSerialInfo;
++    ::memset(&currentSerialInfo, 0, sizeof(currentSerialInfo));
++
+     if (::ioctl(descriptor, TIOCGSERIAL, &currentSerialInfo) == -1)
+         return decodeSystemError();
+-- 
+2.3.2
+
index 8bb168e..c9877c6 100644 (file)
@@ -1,5 +1,9 @@
 require qt5.inc
 
+SRC_URI += " \
+    file://0001-Unix-Clear-serial_struct-instances.patch \
+"
+
 DEPENDS += "qtbase"
 
 # text of LGPL_EXCEPTION.txt and LICENSE.FDL is slightly different than what
diff --git a/meta-qt5/recipes-qt/qt5/qtserialport/0001-Unix-Clear-serial_struct-instances.patch b/meta-qt5/recipes-qt/qt5/qtserialport/0001-Unix-Clear-serial_struct-instances.patch
new file mode 100644 (file)
index 0000000..b14cf01
--- /dev/null
@@ -0,0 +1,42 @@
+From 53afe73154c7c00b54cd280fa3d6c9127a2bc84b Mon Sep 17 00:00:00 2001
+From: Jonathan Liu <net147@gmail.com>
+Date: Mon, 9 Mar 2015 22:35:56 +1100
+Subject: [PATCH] Unix: Clear serial_struct instances
+
+Silences the following Valgrind warning:
+Conditional jump or move depends on uninitialised value(s)
+
+Upstream-Status: Backport from 5.5 branch
+
+Change-Id: I8fd8cfd6aa6f75ed515e6151cfc282faca508bdc
+Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+---
+ src/serialport/qserialport_unix.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp
+index 34ef41d..7cf356b 100644
+--- a/src/serialport/qserialport_unix.cpp
++++ b/src/serialport/qserialport_unix.cpp
+@@ -439,6 +439,8 @@ QSerialPortPrivate::setStandardBaudRate(qint32 baudRate, QSerialPort::Directions
+ {
+     struct serial_struct currentSerialInfo;
++    ::memset(&currentSerialInfo, 0, sizeof(currentSerialInfo));
++
+     if ((::ioctl(descriptor, TIOCGSERIAL, &currentSerialInfo) != -1)
+             && (currentSerialInfo.flags & ASYNC_SPD_CUST)) {
+         currentSerialInfo.flags &= ~ASYNC_SPD_CUST;
+@@ -469,6 +471,8 @@ QSerialPortPrivate::setCustomBaudRate(qint32 baudRate, QSerialPort::Directions d
+     struct serial_struct currentSerialInfo;
++    ::memset(&currentSerialInfo, 0, sizeof(currentSerialInfo));
++
+     if (::ioctl(descriptor, TIOCGSERIAL, &currentSerialInfo) == -1)
+         return decodeSystemError();
+-- 
+2.3.2
+