Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp346962pxu; Thu, 15 Oct 2020 05:38:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOhGCNZ+v9Pigx0Gq/Ec45mFrA0aTauiVxCxc842aD3hOB5rQn7Z43DUw/X6cjPDx8G11L X-Received: by 2002:a17:906:a981:: with SMTP id jr1mr4018611ejb.99.1602765517034; Thu, 15 Oct 2020 05:38:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602765517; cv=none; d=google.com; s=arc-20160816; b=a2gOxgYpYN2fz9cIMS4TV2EPjAQri/aokzSlE8gHLkpTfsPJDbXd13WDmk2eREFiOH XYBFif5UYlAl9ZHYtzVEVN2lAAte5T9J0t8Hy+eUVElAb9OgcTu/+vSGbEJ9KzLQBklV mV1oGfLJERlUlhqDpKoA7BI4LVVbdM3duNwPdFuZwy8O+X2fov4B1L14/SZXOSe56SGc gnLIkeHunnzXkMHkkJPWG2zE+1yvKtGie3OZG5thcp/sZhx4kPZErmfSV8hMA/7hlAit rWoaGzKIvut4FVCEb+Yrw6CSz+5QmQCRFCMTSkMPh0qq6AqAX32yDhiKZmVdrNyK2EtD BqYQ== 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; bh=N+zf2Q8a1L23gAiFSKndJ8ZsLSnEm3/rm8P3CfDiZqc=; b=l147VKSzibQcEa9mI3rzNXdN+FQJJq0++MNT+wxtwN4jU1OCuK9r6/AioYPjFw7ciX H41xcGogEEJqUSemG5M5yDpkUoWT/ketMgA1/AFfq1TZe85Xzl72v2gc6lZ3Ml1qGtio L9OcuDTS8cJ3z2PyT89s5/jELMxiOKkiyTMUgrgsjRbIEvSpR3D26yjcREVbpIWIqh/t /veqq3h3rsPTvwfvjNy0HCUua1Q72/EAaVx3iYA/7lfpG7Lb7SWAYhTIJ0oBn6NPowgU 7K8vcU7XCo1rtIpvN3Szfo93uNLPM4rt+uczE1aLI6aYq1pIC8qrQZ1Rk95uvmtS7omD vqXQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si2431905eja.186.2020.10.15.05.38.10; Thu, 15 Oct 2020 05:38:37 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727906AbgJOMWb (ORCPT + 99 others); Thu, 15 Oct 2020 08:22:31 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:35173 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727278AbgJOMWb (ORCPT ); Thu, 15 Oct 2020 08:22:31 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kT2H4-0006lp-Q3; Thu, 15 Oct 2020 12:22:26 +0000 From: Colin King To: Diana Craciun , Alex Williamson , Cornelia Huck , Eric Auger , kvm@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] vfio/fsl-mc: fix the return of the uninitialized variable ret Date: Thu, 15 Oct 2020 13:22:26 +0100 Message-Id: <20201015122226.485911-1-colin.king@canonical.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King Currently the success path in function vfio_fsl_mc_reflck_attach is returning an uninitialized value in variable ret. Fix this by setting this to zero to indicate success. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: f2ba7e8c947b ("vfio/fsl-mc: Added lock support in preparation for interrupt handling") Signed-off-by: Colin Ian King --- drivers/vfio/fsl-mc/vfio_fsl_mc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vfio/fsl-mc/vfio_fsl_mc.c b/drivers/vfio/fsl-mc/vfio_fsl_mc.c index 80fc7f4ed343..42a5decb78d1 100644 --- a/drivers/vfio/fsl-mc/vfio_fsl_mc.c +++ b/drivers/vfio/fsl-mc/vfio_fsl_mc.c @@ -84,6 +84,7 @@ static int vfio_fsl_mc_reflck_attach(struct vfio_fsl_mc_device *vdev) vfio_fsl_mc_reflck_get(cont_vdev->reflck); vdev->reflck = cont_vdev->reflck; vfio_device_put(device); + ret = 0; } unlock: -- 2.27.0