common/qat: fix uninitialized variable bug
PATCH 1/1 common/qat: fix uninitialized variable bug
This patch fixes the uninitialized variable bug in QAT PMD.
--- drivers/common/qat/qat_qp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/common/qat/qat_qp.c +1 -1
@@ -582,7 +582,7 @@ qat_enqueue_op_burst(void *qp, void **ops, uint16_t nb_ops) registerstruct qat_queue *queue;struct qat_qp *tmp_qp = (struct qat_qp *)qp; registeruint32_t nb_ops_sent =0 ; - registerint ret; + registerint ret =-1 ;uint16_t nb_ops_possible = nb_ops; registeruint8_t *base_addr; registeruint32_t tail;
Signature · 1 line
2.25.1
Trahe, Fiona
NAKQuoted 23 lines
-----Original Message-----
From: Dybkowski, AdamX <[email protected]>
Sent: Friday, July 24, 2020 10:40 AM
To: [email protected]; Trahe, Fiona <[email protected]>; [email protected]
Cc: Dybkowski, AdamX <[email protected]>
Subject: [PATCH] common/qat: fix uninitialized variable bugThis patch fixes the uninitialized variable bug in QAT PMD.
Fixes 9f27a860dc16 ("crypto/qat: move generic qp function to qp file")Signed-off-by Adam Dybkowski <[email protected]>--- drivers/common/qat/qat_qp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/common/qat/qat_qp.c +0
-0
drivers/common/qat/qat_qp.c qat_enqueue_op_burst(void *qp, void **ops, uint16_t nb_ops) · line 585
Quoted 5 lines
drivers/common/qat/qat_qp.c +1
-1@@ -582,7 +582,7 @@ qat_enqueue_op_burst(void *qp, void **ops, uint16_t nb_ops) registerstruct qat_queue *queue;struct qat_qp *tmp_qp = (struct qat_qp *)qp; registeruint32_t nb_ops_sent =0 ; - registerint ret; + registerint ret =-1 ;
Nack - this fn returns an unsigned. So the correct option is to default to 0
Quoted 34 lines
-----Original Message-----
From: Trahe, Fiona <[email protected]>
Sent: Friday, 24 July, 2020 13:55
To: Dybkowski, AdamX <[email protected]>; [email protected]; [email protected]
Cc: Trahe, Fiona <[email protected]>
Subject: RE: [PATCH] common/qat: fix uninitialized variable bugdrivers/common/qat/qat_qp.c qat_enqueue_op_burst(void *qp, void **ops,
Quoted 23 lines
-----Original Message-----
From: Dybkowski, AdamX <[email protected]>
Sent: Friday, July 24, 2020 10:40 AM
To: [email protected]; Trahe, Fiona <[email protected]>; [email protected]
Cc: Dybkowski, AdamX <[email protected]>
Subject: [PATCH] common/qat: fix uninitialized variable bugThis patch fixes the uninitialized variable bug in QAT PMD.
Fixes 9f27a860dc16 ("crypto/qat: move generic qp function to qpfile")
Signed-off-by Adam Dybkowski <[email protected]>--- drivers/common/qat/qat_qp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/common/qat/qat_qp.c +0
-0@@ -582,7 +582,7 @@ qat_enqueue_op_burst(void *qp, void **ops,
uint16_tnb_ops)
Quoted 6 lines
drivers/common/qat/qat_qp.c qat_enqueue_op_burst(void *qp, void **ops, uint16_t nb_ops) · line 585
Quoted 5 lines
drivers/common/qat/qat_qp.c +1
-1registerstruct qat_queue *queue;struct qat_qp *tmp_qp = (struct qat_qp *)qp; registeruint32_t nb_ops_sent =0 ; - registerint ret; + registerint ret =-1 ;Nack - this fn returns an unsigned. So the correct option is to default to 0
[Adam] The ret variable value (signed) is not returned directly, please check the rest of this function in src code. This is just checked to calculate how many ops were enqueued. And if all checks skip (meaning the op was not processed by sym crypto, asym crypto nor compression), we should note the user that the actual op was NOT enqueued. That's why ret is set to -1.
Adam
Trahe, Fiona
Acked-byQuoted 49 lines
-----Original Message-----
From: Dybkowski, AdamX <[email protected]>
Sent: Friday, July 24, 2020 12:58 PM
To: Trahe, Fiona <[email protected]>; [email protected]; [email protected]
Subject: RE: [PATCH] common/qat: fix uninitialized variable bugQuoted 34 lines
-----Original Message-----
From: Trahe, Fiona <[email protected]>
Sent: Friday, 24 July, 2020 13:55
To: Dybkowski, AdamX <[email protected]>; [email protected]; [email protected]
Cc: Trahe, Fiona <[email protected]>
Subject: RE: [PATCH] common/qat: fix uninitialized variable bugdrivers/common/qat/qat_qp.c qat_enqueue_op_burst(void *qp, void **ops,
Quoted 23 lines
-----Original Message-----
From: Dybkowski, AdamX <[email protected]>
Sent: Friday, July 24, 2020 10:40 AM
To: [email protected]; Trahe, Fiona <[email protected]>; [email protected]
Cc: Dybkowski, AdamX <[email protected]>
Subject: [PATCH] common/qat: fix uninitialized variable bugThis patch fixes the uninitialized variable bug in QAT PMD.
Fixes 9f27a860dc16 ("crypto/qat: move generic qp function to qpfile")
Signed-off-by Adam Dybkowski <[email protected]>--- drivers/common/qat/qat_qp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/common/qat/qat_qp.c +0
-0@@ -582,7 +582,7 @@ qat_enqueue_op_burst(void *qp, void **ops,
uint16_tnb_ops)Quoted 6 lines
drivers/common/qat/qat_qp.c qat_enqueue_op_burst(void *qp, void **ops, uint16_t nb_ops) · line 585
Quoted 5 lines
drivers/common/qat/qat_qp.c +1
-1registerstruct qat_queue *queue;struct qat_qp *tmp_qp = (struct qat_qp *)qp; registeruint32_t nb_ops_sent =0 ; - registerint ret; + registerint ret =-1 ;Nack - this fn returns an unsigned. So the correct option is to default to 0
Quoted 4 lines
[Adam] The ret variable value (signed) is not returned directly, please check the rest of this function in src code. This is just checked to calculate how many ops were enqueued. And if all checks skip (meaning the op was not processed by sym crypto, asym crypto nor compression), we should note the user that the actual op was NOT enqueued. That's why ret is set to -1.
[Fiona] ok. makes sense thanks. In that case
Akhil Goyal
AppliedQuoted 10 lines
Quoted 2 lines
[Adam] The ret variable value (signed) is not returned directly, please check the
rest of this function in src
Quoted 1 line
code. This is just checked to calculate how many ops were enqueued. And if all
checks skip (meaning the
Quoted 1 line
op was not processed by sym crypto, asym crypto nor compression), we
should note the user that the
Quoted 1 line
actual op was NOT enqueued. That's why ret is set to -1.
[Fiona] ok. makes sense thanks. In that case
Acked-by Fiona Trahe <[email protected]>
Applied to dpdk-next-crypto
Thanks
26/07/2020 21:19, Akhil Goyal:
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
[Adam] The ret variable value (signed) is not returned directly, please check the
rest of this function in src
Quoted 1 line
code. This is just checked to calculate how many ops were enqueued. And if all
checks skip (meaning the
Quoted 1 line
op was not processed by sym crypto, asym crypto nor compression), we
Quoted 8 lines
Quoted 4 lines
should note the user that the
Quoted 1 line
actual op was NOT enqueued. That's why ret is set to -1.
[Fiona] ok. makes sense thanks. In that case
Acked-by Fiona Trahe <[email protected]>Applied to dpdk-next-crypto
This patch should not have been merged.
The explanation is missing.
This is the commit log:
"This patch fixes the uninitialized variable bug in QAT PMD."
We don't even know what is the consequence and the scope. That's not acceptable for a fix.