* [dpdk-dev] [PATCH 1/2] net/liquidioi/base: fix mbox command initialization
@ 2017-04-10 6:26 Shijith Thotton
2017-04-10 6:26 ` [dpdk-dev] [PATCH 2/2] net/liquidio: fix null pointer check Shijith Thotton
2017-04-10 7:18 ` [dpdk-dev] [PATCH v2 1/2] net/liquidio/base: fix mbox command initialization Shijith Thotton
0 siblings, 2 replies; 5+ messages in thread
From: Shijith Thotton @ 2017-04-10 6:26 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
Initialize mail box command to request VF FLR. Data field was
uninitialized before as it was not required and caused the following
error during scan.
Reported by Coverity scan:
1384518 Uninitialized scalar variable
Fixes: cdb166963cae ("net/liquidio: add API for VF FLR")
Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
---
drivers/net/liquidio/base/lio_23xx_vf.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/liquidio/base/lio_23xx_vf.c b/drivers/net/liquidio/base/lio_23xx_vf.c
index 6ff5b69..e30c20d 100644
--- a/drivers/net/liquidio/base/lio_23xx_vf.c
+++ b/drivers/net/liquidio/base/lio_23xx_vf.c
@@ -31,6 +31,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <string.h>
+
#include <rte_ethdev.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
@@ -382,7 +384,7 @@
{
struct lio_mbox_cmd mbox_cmd;
- mbox_cmd.msg.mbox_msg64 = 0;
+ memset(&mbox_cmd, 0, sizeof(struct lio_mbox_cmd));
mbox_cmd.msg.s.type = LIO_MBOX_REQUEST;
mbox_cmd.msg.s.resp_needed = 0;
mbox_cmd.msg.s.cmd = LIO_VF_FLR_REQUEST;
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH 2/2] net/liquidio: fix null pointer check
2017-04-10 6:26 [dpdk-dev] [PATCH 1/2] net/liquidioi/base: fix mbox command initialization Shijith Thotton
@ 2017-04-10 6:26 ` Shijith Thotton
2017-04-10 7:18 ` [dpdk-dev] [PATCH v2 1/2] net/liquidio/base: fix mbox command initialization Shijith Thotton
1 sibling, 0 replies; 5+ messages in thread
From: Shijith Thotton @ 2017-04-10 6:26 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
Fix null pointer check in release Rx/Tx queue APIs.
Reported by Coverity scan:
1423923 Dereference before null check
1423924 Dereference before null check
Fixes: 9a30013b9884 ("net/liquidio: add API to release Rx queue")
Fixes: cf6bfcbea178 ("net/liquidio: add API to release Tx queue")
Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
---
drivers/net/liquidio/lio_ethdev.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index df91659..a65c749 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -1155,14 +1155,13 @@ struct rte_lio_xstats_name_off {
lio_dev_rx_queue_release(void *rxq)
{
struct lio_droq *droq = rxq;
- struct lio_device *lio_dev = droq->lio_dev;
int oq_no;
- /* Run time queue deletion not supported */
- if (lio_dev->port_configured)
- return;
+ if (droq) {
+ /* Run time queue deletion not supported */
+ if (droq->lio_dev->port_configured)
+ return;
- if (droq != NULL) {
oq_no = droq->q_no;
lio_delete_droq_queue(droq->lio_dev, oq_no);
}
@@ -1250,14 +1249,14 @@ struct rte_lio_xstats_name_off {
lio_dev_tx_queue_release(void *txq)
{
struct lio_instr_queue *tq = txq;
- struct lio_device *lio_dev = tq->lio_dev;
uint32_t fw_mapped_iq_no;
- /* Run time queue deletion not supported */
- if (lio_dev->port_configured)
- return;
- if (tq != NULL) {
+ if (tq) {
+ /* Run time queue deletion not supported */
+ if (tq->lio_dev->port_configured)
+ return;
+
/* Free sg_list */
lio_delete_sglist(tq);
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH v2 1/2] net/liquidio/base: fix mbox command initialization
2017-04-10 6:26 [dpdk-dev] [PATCH 1/2] net/liquidioi/base: fix mbox command initialization Shijith Thotton
2017-04-10 6:26 ` [dpdk-dev] [PATCH 2/2] net/liquidio: fix null pointer check Shijith Thotton
@ 2017-04-10 7:18 ` Shijith Thotton
2017-04-10 7:18 ` [dpdk-dev] [PATCH v2 2/2] net/liquidio: fix null pointer check Shijith Thotton
2017-04-10 10:07 ` [dpdk-dev] [PATCH v2 1/2] net/liquidio/base: fix mbox command initialization Ferruh Yigit
1 sibling, 2 replies; 5+ messages in thread
From: Shijith Thotton @ 2017-04-10 7:18 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
Initialize mail box command to request VF FLR. Data field was
uninitialized before as it was not required and caused the following
error during scan.
Reported by Coverity scan:
1384518 Uninitialized scalar variable
Fixes: cdb166963cae ("net/liquidio: add API for VF FLR")
Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
---
v2 changes:
- Fix typo in commit title (s/liquidioi/liquidio).
drivers/net/liquidio/base/lio_23xx_vf.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/liquidio/base/lio_23xx_vf.c b/drivers/net/liquidio/base/lio_23xx_vf.c
index 6ff5b69..e30c20d 100644
--- a/drivers/net/liquidio/base/lio_23xx_vf.c
+++ b/drivers/net/liquidio/base/lio_23xx_vf.c
@@ -31,6 +31,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <string.h>
+
#include <rte_ethdev.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
@@ -382,7 +384,7 @@
{
struct lio_mbox_cmd mbox_cmd;
- mbox_cmd.msg.mbox_msg64 = 0;
+ memset(&mbox_cmd, 0, sizeof(struct lio_mbox_cmd));
mbox_cmd.msg.s.type = LIO_MBOX_REQUEST;
mbox_cmd.msg.s.resp_needed = 0;
mbox_cmd.msg.s.cmd = LIO_VF_FLR_REQUEST;
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH v2 2/2] net/liquidio: fix null pointer check
2017-04-10 7:18 ` [dpdk-dev] [PATCH v2 1/2] net/liquidio/base: fix mbox command initialization Shijith Thotton
@ 2017-04-10 7:18 ` Shijith Thotton
2017-04-10 10:07 ` [dpdk-dev] [PATCH v2 1/2] net/liquidio/base: fix mbox command initialization Ferruh Yigit
1 sibling, 0 replies; 5+ messages in thread
From: Shijith Thotton @ 2017-04-10 7:18 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
Fix null pointer check in release Rx/Tx queue APIs.
Reported by Coverity scan:
1423923 Dereference before null check
1423924 Dereference before null check
Fixes: 9a30013b9884 ("net/liquidio: add API to release Rx queue")
Fixes: cf6bfcbea178 ("net/liquidio: add API to release Tx queue")
Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
---
drivers/net/liquidio/lio_ethdev.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index df91659..a65c749 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -1155,14 +1155,13 @@ struct rte_lio_xstats_name_off {
lio_dev_rx_queue_release(void *rxq)
{
struct lio_droq *droq = rxq;
- struct lio_device *lio_dev = droq->lio_dev;
int oq_no;
- /* Run time queue deletion not supported */
- if (lio_dev->port_configured)
- return;
+ if (droq) {
+ /* Run time queue deletion not supported */
+ if (droq->lio_dev->port_configured)
+ return;
- if (droq != NULL) {
oq_no = droq->q_no;
lio_delete_droq_queue(droq->lio_dev, oq_no);
}
@@ -1250,14 +1249,14 @@ struct rte_lio_xstats_name_off {
lio_dev_tx_queue_release(void *txq)
{
struct lio_instr_queue *tq = txq;
- struct lio_device *lio_dev = tq->lio_dev;
uint32_t fw_mapped_iq_no;
- /* Run time queue deletion not supported */
- if (lio_dev->port_configured)
- return;
- if (tq != NULL) {
+ if (tq) {
+ /* Run time queue deletion not supported */
+ if (tq->lio_dev->port_configured)
+ return;
+
/* Free sg_list */
lio_delete_sglist(tq);
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/2] net/liquidio/base: fix mbox command initialization
2017-04-10 7:18 ` [dpdk-dev] [PATCH v2 1/2] net/liquidio/base: fix mbox command initialization Shijith Thotton
2017-04-10 7:18 ` [dpdk-dev] [PATCH v2 2/2] net/liquidio: fix null pointer check Shijith Thotton
@ 2017-04-10 10:07 ` Ferruh Yigit
1 sibling, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2017-04-10 10:07 UTC (permalink / raw)
To: Shijith Thotton; +Cc: dev
On 4/10/2017 8:18 AM, Shijith Thotton wrote:
> Initialize mail box command to request VF FLR. Data field was
> uninitialized before as it was not required and caused the following
> error during scan.
>
> Reported by Coverity scan:
> 1384518 Uninitialized scalar variable
>
> Fixes: cdb166963cae ("net/liquidio: add API for VF FLR")
>
> Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
Series applied to dpdk-next-net/master, thanks.
Updated commit logs with the defined syntax for Coverity fixes:
Coverity issue: 1384518
Fixes: cdb166963cae ("net/liquidio: add API for VF FLR")
Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-04-10 10:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-10 6:26 [dpdk-dev] [PATCH 1/2] net/liquidioi/base: fix mbox command initialization Shijith Thotton
2017-04-10 6:26 ` [dpdk-dev] [PATCH 2/2] net/liquidio: fix null pointer check Shijith Thotton
2017-04-10 7:18 ` [dpdk-dev] [PATCH v2 1/2] net/liquidio/base: fix mbox command initialization Shijith Thotton
2017-04-10 7:18 ` [dpdk-dev] [PATCH v2 2/2] net/liquidio: fix null pointer check Shijith Thotton
2017-04-10 10:07 ` [dpdk-dev] [PATCH v2 1/2] net/liquidio/base: fix mbox command initialization Ferruh Yigit
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).