From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02862C433E7 for ; Thu, 15 Oct 2020 12:22:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 94A5822249 for ; Thu, 15 Oct 2020 12:22:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728000AbgJOMWb (ORCPT ); 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