Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2116218pxb; Fri, 8 Oct 2021 00:49:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypqoycyWodhIsET6A0siWNZ//1tzAyz4WBu5B3p7J2GhF7pdwg//ihybUO0F9VIWrrfkye X-Received: by 2002:a50:d844:: with SMTP id v4mr13393245edj.378.1633679391175; Fri, 08 Oct 2021 00:49:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633679391; cv=none; d=google.com; s=arc-20160816; b=RAgVYGVwmy/HSlqXM1nz8rHSV4kAAO4o8gpbyVH6T4Q1mRkKsTQxbC8QLLoXOn2wcu TaCfeCagpudsdqIdQYuy56l5gnhW/lYfWKE6DnLULOaDOXt4t0agghH7PVcKMlDowmd6 GXPeq/p+JLtb5a/zkX1VOciSwakIJetY2qRub+yYv723tkSuu7wT5gIw95f+PW3Qy0lU cGFiwJtRjHoH/fMLz7zFspVjLquNloeHWABJ1hKZp0jQjMi14tRR0TQ5VmXzmqkLE14h sFqWh0wSyxIPORZHgzn6+DjrYNHPLMfhKvJX7fadnTEjz/Q/dT3zcUdtkVTwd+vxD4U/ +enQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=W0jUXmIh5Vl68dC4YUDFSEv41y48kkR8m8aRKIpiZUw=; b=HukvKAlAqsqpcQDyCORi8LtjfBixVGbM3IdT7lrY8cWoWLyMDrv6WifwKVhyHadLeh lU4ci1rQimpXNk9Aqfg7ZoNBOgQCEwMqkhUg0oMlrs2d9/y+KljodltztExndiBbKQwa lZEfLZRLx8Q+KF6ugvIQNdaUerGOvwBbw6FtKtRBKprUd6GHFsHf+188Db24LFbkLrHz mYeyODfOumLXsz8i3gtMe3LBnTEGQvc7HgPluM7Vovw0c5ovChlSMqlk+ThnpX5xprZO Uk45ISemK5GG85DdAA92TK3EVcwGgu9yPKKIfBFX650F127eg70ZNEYXH0Znf79uQ1aX 0EpA== 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=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gf4si2469202ejb.150.2021.10.08.00.49.26; Fri, 08 Oct 2021 00:49:51 -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=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232766AbhJHHr0 (ORCPT + 99 others); Fri, 8 Oct 2021 03:47:26 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:13877 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229788AbhJHHrX (ORCPT ); Fri, 8 Oct 2021 03:47:23 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4HQg8n2vzdz909M; Fri, 8 Oct 2021 15:40:41 +0800 (CST) Received: from dggema769-chm.china.huawei.com (10.1.198.211) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.8; Fri, 8 Oct 2021 15:45:23 +0800 Received: from localhost (10.174.179.215) by dggema769-chm.china.huawei.com (10.1.198.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.8; Fri, 8 Oct 2021 15:45:23 +0800 From: YueHaibing To: , , CC: , , YueHaibing Subject: [PATCH -next] xen-pciback: Fix return in pm_ctrl_init() Date: Fri, 8 Oct 2021 15:44:17 +0800 Message-ID: <20211008074417.8260-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.179.215] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggema769-chm.china.huawei.com (10.1.198.211) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return NULL instead of passing to ERR_PTR while err is zero, this fix smatch warnings: drivers/xen/xen-pciback/conf_space_capability.c:163 pm_ctrl_init() warn: passing zero to 'ERR_PTR' Fixes: a92336a1176b ("xen/pciback: Drop two backends, squash and cleanup some code.") Signed-off-by: YueHaibing --- drivers/xen/xen-pciback/conf_space_capability.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/xen-pciback/conf_space_capability.c b/drivers/xen/xen-pciback/conf_space_capability.c index 22f13abbe913..5e53b4817f16 100644 --- a/drivers/xen/xen-pciback/conf_space_capability.c +++ b/drivers/xen/xen-pciback/conf_space_capability.c @@ -160,7 +160,7 @@ static void *pm_ctrl_init(struct pci_dev *dev, int offset) } out: - return ERR_PTR(err); + return err ? ERR_PTR(err) : NULL; } static const struct config_field caplist_pm[] = { -- 2.17.1