All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net/mlx5e: Uninitialized variable in mlx5e_attach_decap()
@ 2020-05-28 12:48 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2020-05-28 12:48 UTC (permalink / raw)
  To: Saeed Mahameed
  Cc: Leon Romanovsky, David S. Miller, Jakub Kicinski, Vlad Buslov,
	Roi Dayan, Paul Blakey, Eli Cohen, netdev, linux-rdma,
	kernel-janitors

The "ret" variable isn't initialized on the success path.

There is an uninitentional behavior in current releases of GCC where
instead of warning about the uninitialized variable, it instead
initializes it to zero.  So that means that this bug likely doesn't
affect testing.

Fixes: 14e6b038afa0 ("net/mlx5e: Add support for hw decapsulation of MPLS over UDP")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 571da14809fec..ae53bf5994215 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -3637,7 +3637,7 @@ static int mlx5e_attach_decap(struct mlx5e_priv *priv,
 	struct mlx5e_decap_entry *d;
 	struct mlx5e_decap_key key;
 	uintptr_t hash_key;
-	int err;
+	int err = 0;
 
 	parse_attr = attr->parse_attr;
 	if (sizeof(parse_attr->eth) > MLX5_CAP_ESW(priv->mdev, max_encap_header_size)) {
-- 
2.26.2


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

* [PATCH net-next] net/mlx5e: Uninitialized variable in mlx5e_attach_decap()
@ 2020-05-28 12:48 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2020-05-28 12:48 UTC (permalink / raw)
  To: Saeed Mahameed
  Cc: Leon Romanovsky, David S. Miller, Jakub Kicinski, Vlad Buslov,
	Roi Dayan, Paul Blakey, Eli Cohen, netdev, linux-rdma,
	kernel-janitors

The "ret" variable isn't initialized on the success path.

There is an uninitentional behavior in current releases of GCC where
instead of warning about the uninitialized variable, it instead
initializes it to zero.  So that means that this bug likely doesn't
affect testing.

Fixes: 14e6b038afa0 ("net/mlx5e: Add support for hw decapsulation of MPLS over UDP")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 571da14809fec..ae53bf5994215 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -3637,7 +3637,7 @@ static int mlx5e_attach_decap(struct mlx5e_priv *priv,
 	struct mlx5e_decap_entry *d;
 	struct mlx5e_decap_key key;
 	uintptr_t hash_key;
-	int err;
+	int err = 0;
 
 	parse_attr = attr->parse_attr;
 	if (sizeof(parse_attr->eth) > MLX5_CAP_ESW(priv->mdev, max_encap_header_size)) {
-- 
2.26.2

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

* Re: [PATCH net-next] net/mlx5e: Uninitialized variable in mlx5e_attach_decap()
  2020-05-28 12:48 ` Dan Carpenter
@ 2020-05-28 20:56   ` Saeed Mahameed
  -1 siblings, 0 replies; 4+ messages in thread
From: Saeed Mahameed @ 2020-05-28 20:56 UTC (permalink / raw)
  To: dan.carpenter
  Cc: linux-rdma, kernel-janitors, davem, Vlad Buslov, Paul Blakey,
	Eli Cohen, netdev, kuba, leon, Roi Dayan

On Thu, 2020-05-28 at 15:48 +0300, Dan Carpenter wrote:
> The "ret" variable isn't initialized on the success path.
> 
> There is an uninitentional behavior in current releases of GCC where
> instead of warning about the uninitialized variable, it instead
> initializes it to zero.  So that means that this bug likely doesn't
> affect testing.
> 
> Fixes: 14e6b038afa0 ("net/mlx5e: Add support for hw decapsulation of
> MPLS over UDP")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Hi Dan,

thanks for the fix,  a similar fix was already submitted yesterday and
i already pulled it into my tree, I will send a pull request to net-
next soon.

Thanks,
Saeed.


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

* Re: [PATCH net-next] net/mlx5e: Uninitialized variable in mlx5e_attach_decap()
@ 2020-05-28 20:56   ` Saeed Mahameed
  0 siblings, 0 replies; 4+ messages in thread
From: Saeed Mahameed @ 2020-05-28 20:56 UTC (permalink / raw)
  To: dan.carpenter
  Cc: linux-rdma, kernel-janitors, davem, Vlad Buslov, Paul Blakey,
	Eli Cohen, netdev, kuba, leon, Roi Dayan

T24gVGh1LCAyMDIwLTA1LTI4IGF0IDE1OjQ4ICswMzAwLCBEYW4gQ2FycGVudGVyIHdyb3RlOg0K
PiBUaGUgInJldCIgdmFyaWFibGUgaXNuJ3QgaW5pdGlhbGl6ZWQgb24gdGhlIHN1Y2Nlc3MgcGF0
aC4NCj4gDQo+IFRoZXJlIGlzIGFuIHVuaW5pdGVudGlvbmFsIGJlaGF2aW9yIGluIGN1cnJlbnQg
cmVsZWFzZXMgb2YgR0NDIHdoZXJlDQo+IGluc3RlYWQgb2Ygd2FybmluZyBhYm91dCB0aGUgdW5p
bml0aWFsaXplZCB2YXJpYWJsZSwgaXQgaW5zdGVhZA0KPiBpbml0aWFsaXplcyBpdCB0byB6ZXJv
LiAgU28gdGhhdCBtZWFucyB0aGF0IHRoaXMgYnVnIGxpa2VseSBkb2Vzbid0DQo+IGFmZmVjdCB0
ZXN0aW5nLg0KPiANCj4gRml4ZXM6IDE0ZTZiMDM4YWZhMCAoIm5ldC9tbHg1ZTogQWRkIHN1cHBv
cnQgZm9yIGh3IGRlY2Fwc3VsYXRpb24gb2YNCj4gTVBMUyBvdmVyIFVEUCIpDQo+IFNpZ25lZC1v
ZmYtYnk6IERhbiBDYXJwZW50ZXIgPGRhbi5jYXJwZW50ZXJAb3JhY2xlLmNvbT4NCg0KSGkgRGFu
LA0KDQp0aGFua3MgZm9yIHRoZSBmaXgsICBhIHNpbWlsYXIgZml4IHdhcyBhbHJlYWR5IHN1Ym1p
dHRlZCB5ZXN0ZXJkYXkgYW5kDQppIGFscmVhZHkgcHVsbGVkIGl0IGludG8gbXkgdHJlZSwgSSB3
aWxsIHNlbmQgYSBwdWxsIHJlcXVlc3QgdG8gbmV0LQ0KbmV4dCBzb29uLg0KDQpUaGFua3MsDQpT
YWVlZC4NCg0K

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

end of thread, other threads:[~2020-05-28 20:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28 12:48 [PATCH net-next] net/mlx5e: Uninitialized variable in mlx5e_attach_decap() Dan Carpenter
2020-05-28 12:48 ` Dan Carpenter
2020-05-28 20:56 ` Saeed Mahameed
2020-05-28 20:56   ` Saeed Mahameed

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.