DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/3] eal/linuxapp: fix invalid syntax in interrupts
@ 2018-06-01  9:08 Anatoly Burakov
  2018-06-01  9:08 ` [dpdk-dev] [PATCH 2/3] eal/linux: fix uninitialized value Anatoly Burakov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Anatoly Burakov @ 2018-06-01  9:08 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, stable

Parentheses were missing. It worked because macro is enclosed in
parentheses, so syntax was valid after macro expansion.

Bugzilla ID: 58
Fixes: 0a45657a6794 ("pci: rework interrupt handling")
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/linuxapp/eal/eal_interrupts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_interrupts.c b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
index 056d41c12..a631124d3 100644
--- a/lib/librte_eal/linuxapp/eal/eal_interrupts.c
+++ b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
@@ -420,7 +420,7 @@ rte_intr_callback_register(const struct rte_intr_handle *intr_handle,
 	TAILQ_FOREACH(src, &intr_sources, next) {
 		if (src->intr_handle.fd == intr_handle->fd) {
 			/* we had no interrupts for this */
-			if TAILQ_EMPTY(&src->callbacks)
+			if (TAILQ_EMPTY(&src->callbacks))
 				wake_thread = 1;
 
 			TAILQ_INSERT_TAIL(&(src->callbacks), callback, next);
-- 
2.17.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-dev] [PATCH 2/3] eal/linux: fix uninitialized value
  2018-06-01  9:08 [dpdk-dev] [PATCH 1/3] eal/linuxapp: fix invalid syntax in interrupts Anatoly Burakov
@ 2018-06-01  9:08 ` Anatoly Burakov
  2018-06-01  9:08 ` [dpdk-dev] [PATCH 3/3] vfio: fix uninitialized variable Anatoly Burakov
  2018-07-13  9:45 ` [dpdk-dev] [PATCH 1/3] eal/linuxapp: fix invalid syntax in interrupts Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Anatoly Burakov @ 2018-06-01  9:08 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, benjamin.walker, stable

The value is not used, but some static analyzers may give out a
warning. Fix it by assigning default value of zero.

Bugzilla ID: 58
Fixes: cdc242f260e7 ("eal/linux: support running as unprivileged user")
Cc: benjamin.walker@intel.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/linuxapp/eal/eal_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index c917de1c2..c53e6ed36 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -66,7 +66,7 @@ static bool phys_addrs_available = true;
 static void
 test_phys_addrs_available(void)
 {
-	uint64_t tmp;
+	uint64_t tmp = 0;
 	phys_addr_t physaddr;
 
 	if (!rte_eal_has_hugepages()) {
-- 
2.17.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-dev] [PATCH 3/3] vfio: fix uninitialized variable
  2018-06-01  9:08 [dpdk-dev] [PATCH 1/3] eal/linuxapp: fix invalid syntax in interrupts Anatoly Burakov
  2018-06-01  9:08 ` [dpdk-dev] [PATCH 2/3] eal/linux: fix uninitialized value Anatoly Burakov
@ 2018-06-01  9:08 ` Anatoly Burakov
  2018-07-13  9:45 ` [dpdk-dev] [PATCH 1/3] eal/linuxapp: fix invalid syntax in interrupts Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Anatoly Burakov @ 2018-06-01  9:08 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, xiao.w.wang, stable

Some static analyzers complain about it, even though
value is never used if not initialized. To avoid additional
false positives about a potential null-pointer dereferences,
also add a null-check.

Bugzilla ID: 58
Fixes: ea2dc1066870 ("vfio: add multi container support")
Cc: xiao.w.wang@intel.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/linuxapp/eal/eal_vfio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index a2bbdfbf4..4b7fcf3d6 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -1778,7 +1778,7 @@ int __rte_experimental
 rte_vfio_container_group_unbind(int container_fd, int iommu_group_num)
 {
 	struct vfio_config *vfio_cfg;
-	struct vfio_group *cur_grp;
+	struct vfio_group *cur_grp = NULL;
 	int i;
 
 	vfio_cfg = get_vfio_cfg_by_container_fd(container_fd);
@@ -1795,7 +1795,7 @@ rte_vfio_container_group_unbind(int container_fd, int iommu_group_num)
 	}
 
 	/* This should not happen */
-	if (i == VFIO_MAX_GROUPS) {
+	if (i == VFIO_MAX_GROUPS || cur_grp == NULL) {
 		RTE_LOG(ERR, EAL, "Specified group number not found\n");
 		return -1;
 	}
-- 
2.17.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH 1/3] eal/linuxapp: fix invalid syntax in interrupts
  2018-06-01  9:08 [dpdk-dev] [PATCH 1/3] eal/linuxapp: fix invalid syntax in interrupts Anatoly Burakov
  2018-06-01  9:08 ` [dpdk-dev] [PATCH 2/3] eal/linux: fix uninitialized value Anatoly Burakov
  2018-06-01  9:08 ` [dpdk-dev] [PATCH 3/3] vfio: fix uninitialized variable Anatoly Burakov
@ 2018-07-13  9:45 ` Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2018-07-13  9:45 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: dev, ferruh.yigit, stable

01/06/2018 11:08, Anatoly Burakov:
> Parentheses were missing. It worked because macro is enclosed in
> parentheses, so syntax was valid after macro expansion.
> 
> Bugzilla ID: 58
> Fixes: 0a45657a6794 ("pci: rework interrupt handling")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>

Series applied, thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-13  9:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-01  9:08 [dpdk-dev] [PATCH 1/3] eal/linuxapp: fix invalid syntax in interrupts Anatoly Burakov
2018-06-01  9:08 ` [dpdk-dev] [PATCH 2/3] eal/linux: fix uninitialized value Anatoly Burakov
2018-06-01  9:08 ` [dpdk-dev] [PATCH 3/3] vfio: fix uninitialized variable Anatoly Burakov
2018-07-13  9:45 ` [dpdk-dev] [PATCH 1/3] eal/linuxapp: fix invalid syntax in interrupts Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).