Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp137071pxb; Fri, 8 Jan 2021 00:27:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8xdpjZk3evQpJhNpva2OFJdSZ7TnyYmaB3XmF5MMqKX0cnmVxe/TOuPPjJgwWvZnhgyvQ X-Received: by 2002:a17:906:354a:: with SMTP id s10mr1934487eja.335.1610094476784; Fri, 08 Jan 2021 00:27:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610094476; cv=none; d=google.com; s=arc-20160816; b=uHQpI4J2NOgqWR0l0Bd5Hd65sqb725t1ujZrfiBjpyRXNkiYTG6PAyQ9HIxWaOVE7s OIykbYoW0bPO6vYeuxlu7blT2Ar1Y1RFsGpvHDvVj21+OLzqyijHTr2TuppPpMPKuVzg Jxe6xV3gZo/dcCNVl1LNxV28MlAvyIDfEZaVCAaXidcbtQMdfRZB8rdRmqv0nrf8ZY0c ZCkwpl6A96XNfrhkoJctnG/0GYTXG9hDt5NkXKgLOOPyfWcLgsOYAk70JhV54so3QG4F bcvQpn3JzzAgpT2hKxvpsjA0WyS+U4ZKwPk8ybmHe7R38rgaTzEgPkJoPG90K90ifYqW jfbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=D+IuUwBOwg8hNsyqoX4+8hAWhxTgkK/XQNwgdiHxBek=; b=Bwvw6e20tbNcv+wBD2+TafgR9w4inI5eJfbLeG/PAhJIR1KK3j6otXQHzwKvCP4/Eo cE4RSFznOPtY6WnI9PYSZpixOKgrxxcKZctUDnxToSYA4mr2uv60uKjQZm+R52g58I1s dNFwCbepdncBBbCwwytuwOTx3ojUA17jDd3jKlB0g/5egsvLvAkKx36Wx+Ew+p7mP4iG T1O+/tsE+XyseLCaGL3jdEmGrAOWvbjzW1YAwQC7kc1n7AZWMJp5A92hmf3fG7SmT/XH iVEWT0QyiDwt8UAAFgrkWKtaaF8lcZp7deEVft3r3G1dbmEV3GxQFgJMIo94aaYx74t8 JCuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="i2dTczA/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z14si3345237edr.470.2021.01.08.00.27.33; Fri, 08 Jan 2021 00:27:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="i2dTczA/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727270AbhAHI0W (ORCPT + 99 others); Fri, 8 Jan 2021 03:26:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:55661 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726312AbhAHI0W (ORCPT ); Fri, 8 Jan 2021 03:26:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610094295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=D+IuUwBOwg8hNsyqoX4+8hAWhxTgkK/XQNwgdiHxBek=; b=i2dTczA/fCUy1VwBwDIDiSb1FN3j+0MZCNaziiIzOp+KHiT8PAVJOen8jQi015icWp4XK5 30bOa+M1FwJM4QxBoLP2KntDji/U+Cse6UtcLPeIZLSx9Ails+xNGJxr1cvbRMwQfyj3XH 0TzejLGvsujoLuRgq+RsT5MMmF6XXLI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-59-daqfk_FRPGiSBT6dZBS_dQ-1; Fri, 08 Jan 2021 03:24:52 -0500 X-MC-Unique: daqfk_FRPGiSBT6dZBS_dQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1AC2E180A08A; Fri, 8 Jan 2021 08:24:51 +0000 (UTC) Received: from jason-ThinkPad-X1-Carbon-6th.redhat.com (ovpn-12-229.pek2.redhat.com [10.72.12.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2FA055D9E4; Fri, 8 Jan 2021 08:24:44 +0000 (UTC) From: Jason Wang To: mst@redhat.com, jasowang@redhat.com Cc: elic@nvidia.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH] mlx5: vdpa: fix possible uninitialized var Date: Fri, 8 Jan 2021 16:24:43 +0800 Message-Id: <20210108082443.5609-1-jasowang@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Upstream: posted When compiling with -Werror=maybe-uninitialized, gcc may complains the possible uninitialized umem. Fix that. Signed-off-by: Jason Wang --- 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); -- 2.25.1