mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Eli Cohen <elic@nvidia.com>
Cc: mst@redhat.com, virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mlx5: vdpa: fix possible uninitialized var
Date: Tue, 12 Jan 2021 10:53:54 +0800	[thread overview]
Message-ID: <ae775c12-65d1-6623-be54-8d9e9be08fd0@redhat.com> (raw)
In-Reply-To: <20210110063955.GA115874@mtl-vdi-166.wap.labs.mlnx>


On 2021/1/10 下午2:39, Eli Cohen wrote:
> On Fri, Jan 08, 2021 at 04:24:43PM +0800, Jason Wang wrote:
>> Upstream: posted
>>
>> When compiling with -Werror=maybe-uninitialized, gcc may complains the
>> possible uninitialized umem. Fix that.
>>
>> Signed-off-by: Jason Wang <jasowang@redhat.com>
>> ---
>>   drivers/vdpa/mlx5/net/mlx5_vnet.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
>> index f1d54814db97..a6ad83d8d8e2 100644
>> --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
>> +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
>> @@ -706,6 +706,9 @@ static void umem_destroy(struct mlx5_vdpa_net *ndev, struct mlx5_vdpa_virtqueue
>>   	case 3:
>>   		umem = &mvq->umem3;
>>   		break;
>> +	default:
>> +		WARN(1, "unsupported umem num %d\n", num);
>> +		return;
>>   	}
>>   
>>   	MLX5_SET(destroy_umem_in, in, opcode, MLX5_CMD_OP_DESTROY_UMEM);
> Since the "default" case will never be executed, maybe it's better to
> just change "case 3:" to "default:" and avoid the WARN().


Fine with me. Will do that in V3.

Thanks


>
>> -- 
>> 2.25.1
>>


      reply	other threads:[~2021-01-12  2:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08  8:24 Jason Wang
2021-01-10  6:39 ` Eli Cohen
2021-01-12  2:53   ` Jason Wang [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=ae775c12-65d1-6623-be54-8d9e9be08fd0@redhat.com \
    --to=jasowang@redhat.com \
    --cc=elic@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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

all inboxes | Powered by JetHome®