* [PATCH][next] net: atlantic: fix missing | operator when assigning rec->llc
@ 2020-04-01 23:27 Colin King
2020-04-02 11:40 ` [EXT] " Igor Russkikh
2020-04-02 13:51 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2020-04-01 23:27 UTC (permalink / raw)
To: Igor Russkikh, David S . Miller, Mark Starovoytov,
Dmitry Bogdanov, netdev
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
rec->llc is currently being assigned twice, once with the lower 8 bits
from packed_record[8] and then re-assigned afterwards with data from
packed_record[9]. This looks like a type, I believe the second assignment
should be using the |= operator rather than a direct assignment.
Addresses-Coverity: ("Unused value")
Fixes: b8f8a0b7b5cb ("net: atlantic: MACSec ingress offload HW bindings")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/ethernet/aquantia/atlantic/macsec/macsec_api.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/aquantia/atlantic/macsec/macsec_api.c b/drivers/net/ethernet/aquantia/atlantic/macsec/macsec_api.c
index 97901c114bfa..fbe9d88b13c7 100644
--- a/drivers/net/ethernet/aquantia/atlantic/macsec/macsec_api.c
+++ b/drivers/net/ethernet/aquantia/atlantic/macsec/macsec_api.c
@@ -491,7 +491,7 @@ get_ingress_preclass_record(struct aq_hw_s *hw,
rec->snap[1] = packed_record[8] & 0xFF;
rec->llc = (packed_record[8] >> 8) & 0xFF;
- rec->llc = packed_record[9] << 8;
+ rec->llc |= packed_record[9] << 8;
rec->mac_sa[0] = packed_record[10];
rec->mac_sa[0] |= packed_record[11] << 16;
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [EXT] [PATCH][next] net: atlantic: fix missing | operator when assigning rec->llc
2020-04-01 23:27 [PATCH][next] net: atlantic: fix missing | operator when assigning rec->llc Colin King
@ 2020-04-02 11:40 ` Igor Russkikh
2020-04-02 13:51 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Igor Russkikh @ 2020-04-02 11:40 UTC (permalink / raw)
To: Colin King, David S . Miller, Mark Starovoytov, Dmitry Bogdanov, netdev
Cc: kernel-janitors, linux-kernel
Thanks Colin,
We also found this typo recently, but you were ahead of us )
> From: Colin Ian King <colin.king@canonical.com>
> rec->llc is currently being assigned twice, once with the lower 8 bits
> from packed_record[8] and then re-assigned afterwards with data from packed_record[9]. This looks like a type,
> I believe the second assignment should be using the |= operator rather than a direct assignment.
> Addresses-Coverity: ("Unused value")
> Fixes: b8f8a0b7b5cb ("net: atlantic: MACSec ingress offload HW bindings")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Igor Russkikh <irusskikh@marell.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][next] net: atlantic: fix missing | operator when assigning rec->llc
2020-04-01 23:27 [PATCH][next] net: atlantic: fix missing | operator when assigning rec->llc Colin King
2020-04-02 11:40 ` [EXT] " Igor Russkikh
@ 2020-04-02 13:51 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-04-02 13:51 UTC (permalink / raw)
To: colin.king
Cc: irusskikh, mstarovoitov, dbogdanov, netdev, kernel-janitors,
linux-kernel
From: Colin King <colin.king@canonical.com>
Date: Thu, 2 Apr 2020 00:27:36 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> rec->llc is currently being assigned twice, once with the lower 8 bits
> from packed_record[8] and then re-assigned afterwards with data from
> packed_record[9]. This looks like a type, I believe the second assignment
> should be using the |= operator rather than a direct assignment.
>
> Addresses-Coverity: ("Unused value")
> Fixes: b8f8a0b7b5cb ("net: atlantic: MACSec ingress offload HW bindings")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-02 13:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-01 23:27 [PATCH][next] net: atlantic: fix missing | operator when assigning rec->llc Colin King
2020-04-02 11:40 ` [EXT] " Igor Russkikh
2020-04-02 13:51 ` David Miller
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).