netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vlad Buslov <vladbu@nvidia.com>
To: Saeed Mahameed <saeedm@nvidia.com>,
	Colin King <colin.king@canonical.com>
Cc: Leon Romanovsky <leon@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Mark Bloch <mbloch@nvidia.com>,
	Roi Dayan <roid@nvidia.com>, <netdev@vger.kernel.org>,
	<linux-rdma@vger.kernel.org>, <kernel-janitors@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][next] net/mlx5: Bridge: Fix uninitialized variable err
Date: Wed, 18 Aug 2021 18:16:30 +0300	[thread overview]
Message-ID: <ygnhbl5upyup.fsf@nvidia.com> (raw)
In-Reply-To: <20210818142558.36722-1-colin.king@canonical.com>

On Wed 18 Aug 2021 at 17:25, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> A recent change removed the assignment of err to the return from
> the call mlx5_esw_bridge_lower_rep_vport_num_vhca_id_get, so now
> err is uninitialized. This is problematic in the switch statement
> where attr-id is SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS, there
> is now a possibility of err not being assigned and the function
> returning a garbage value in err. Fix this by initializing err
> to zero.
>
> Addresses-Coverity; ("Uninitialized scalar variable")
> Fixes: ff9b7521468b ("net/mlx5: Bridge, support LAG")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---

Colin, thanks for fixing this!

Saeed, I've already submitted fix for this and another similar Coverity
issue (in mlx5_esw_bridge_port_changeupper()) internally. This patch is
exactly the same one line fix as mine, so you can take whichever you
prefer.

Reviewed-by: Vlad Buslov <vladbu@nvidia.com>

[...]



      reply	other threads:[~2021-08-18 15:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 14:25 [PATCH][next] net/mlx5: Bridge: Fix uninitialized variable err Colin King
2021-08-18 15:16 ` Vlad Buslov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ygnhbl5upyup.fsf@nvidia.com \
    --to=vladbu@nvidia.com \
    --cc=colin.king@canonical.com \
    --cc=davem@davemloft.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=roid@nvidia.com \
    --cc=saeedm@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).