txr->dev_state is always manipulated after acquiring the transmit queue
lock, except in bnxt_tx_enable(), which seems suspicious here, so also
acquire the transmit queue lock before changing the value.
Reported-by: coverity (CID 1339583)
Fixes: c0c050c58d840 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 ++
1 file changed, 2 insertions(+)
You're going to have to explain how this could possibly cause a
problem, because I'm pretty sure it can't.
Either the reader sees 0, or non-zero, in this value.
And adding locking around this assignment does not change that at all.
You're going to have to explain how this could possibly cause a
problem, because I'm pretty sure it can't.
Either the reader sees 0, or non-zero, in this value.
And adding locking around this assignment does not change that at all.
Florian, I agree with David. The lock is not needed. The lock in
bnxt_tx_disable() is also unnecessary and should be removed. Thanks.
txr->dev_state was not consistently manipulated with the acquisition of
the per-queue lock, after further inspection the lock does not seem
necessary, either the value is read as BNXT_DEV_STATE_CLOSING or 0.
Reported-by: coverity (CID 1339583)
Fixes: c0c050c58d840 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes in v2:
- remove locking in bnxt_tx_disable() as recommended by Michael
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 --
1 file changed, 2 deletions(-)
From: Michael Chan <michael.chan@broadcom.com> Date: 2016-07-18 20:06:52
On Mon, Jul 18, 2016 at 1:02 PM, Florian Fainelli [off-list ref] wrote:
txr->dev_state was not consistently manipulated with the acquisition of
the per-queue lock, after further inspection the lock does not seem
necessary, either the value is read as BNXT_DEV_STATE_CLOSING or 0.
Reported-by: coverity (CID 1339583)
Fixes: c0c050c58d840 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Thanks Florian.
Acked-by: Michael Chan <michael.chan@broadcom.com>
txr->dev_state was not consistently manipulated with the acquisition of
the per-queue lock, after further inspection the lock does not seem
necessary, either the value is read as BNXT_DEV_STATE_CLOSING or 0.
Reported-by: coverity (CID 1339583)
Fixes: c0c050c58d840 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes in v2:
- remove locking in bnxt_tx_disable() as recommended by Michael