Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1118574img; Fri, 22 Mar 2019 16:22:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwU/zCTRPwukl84dP85NUOqAHARlsopk/GVcRDF5IJyq1tEHACGGQdGz5ZGgDXSAZZ+rf9n X-Received: by 2002:a62:4e8e:: with SMTP id c136mr11918311pfb.254.1553296970192; Fri, 22 Mar 2019 16:22:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553296970; cv=none; d=google.com; s=arc-20160816; b=hr5cThe9PZjIv1DO35oXvg4Tc4msOKGXb4JeVCwp+R1l/VQbXBzR/18Xo15VNLta6U DlzkrfTzi4bLwA18wvw9ON9FINwl7eBvmSOyNND0KYUqjVM69cu2WKmLSi5eENO3REC4 zQurYeuRr1rO9oKY9B9JAv6+x4BIIMYwkmRC0j3NeHWE0n1W8PPUV/o9JosMRR9+YdQd JtAh2DJ5v/+pKIZR8lOG6MGjHIHQqeStZ9Jz1WA8b/Eb9tARUpi+baZmx9LzKsluyC4s PX0HVrvCIHo7AKQ6nT7UNs35LfihKbl5EChYqdv4VZUlvjaLXMqD8nzCIy6bg3da6fpw PNUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=qW7icrdS2ubcDgEwCg6ZM1HBW9bEhPCOX1BTybnCds0=; b=aUv2Z/rRbspPT5Na0RMRCzIgLnR99oJk3Sg4ee5QfgIrRy6XobWwClYkwUlig0txEu 81CLUzl48Y0SA3B0oB0EJYJOS9tEgGLig8s732bspPFXT+9SqKExNWw2ieQX/ttvfE5G jnI7Fe47ekuqJRQr8tt2ud3wmLGiH2yJMaAyAqhsUEXCG5tjuzjdTrpxXiJoLtq/UsN2 VbWxXj1ppo9SK+EPwXBi7TrYVYXqlXEFR9U7yUz44HwQrdBmQB1UWmjplDz3mABtgLOM +j8HarNxvC0XA9xFMezTKnpuO5So8RsakoT1wvD92mTP7k5Oc4hZCXH7slLIl/VXne+P PMJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a8si7491143pff.277.2019.03.22.16.22.35; Fri, 22 Mar 2019 16:22:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728478AbfCVXU4 (ORCPT + 99 others); Fri, 22 Mar 2019 19:20:56 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:56820 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728454AbfCVXUy (ORCPT ); Fri, 22 Mar 2019 19:20:54 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from parav@mellanox.com) with ESMTPS (AES256-SHA encrypted); 23 Mar 2019 01:20:52 +0200 Received: from sw-mtx-036.mtx.labs.mlnx (sw-mtx-036.mtx.labs.mlnx [10.12.150.149]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x2MNKaw3007896; Sat, 23 Mar 2019 01:20:50 +0200 From: Parav Pandit To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, kwankhede@nvidia.com, alex.williamson@redhat.com Cc: parav@mellanox.com Subject: [PATCH 5/8] vfio/mdev: Avoid masking error code to EBUSY Date: Fri, 22 Mar 2019 18:20:32 -0500 Message-Id: <1553296835-37522-6-git-send-email-parav@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1553296835-37522-1-git-send-email-parav@mellanox.com> References: <1553296835-37522-1-git-send-email-parav@mellanox.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Instead of masking return error to -EBUSY, return actual error returned by the driver. Signed-off-by: Parav Pandit --- drivers/vfio/mdev/mdev_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c index 3d91f62..ab05464 100644 --- a/drivers/vfio/mdev/mdev_core.c +++ b/drivers/vfio/mdev/mdev_core.c @@ -142,7 +142,7 @@ static int mdev_device_remove_ops(struct mdev_device *mdev, bool force_remove) */ ret = parent->ops->remove(mdev); if (ret && !force_remove) - return -EBUSY; + return ret; sysfs_remove_groups(&mdev->dev.kobj, parent->ops->mdev_attr_groups); return 0; -- 1.8.3.1