From patchwork Wed Feb 10 07:54:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 12080043 X-Patchwork-Delegate: kuba@kernel.org 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 208F3C433DB for ; Wed, 10 Feb 2021 07:48:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE19F64E3B for ; Wed, 10 Feb 2021 07:48:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232992AbhBJHsp (ORCPT ); Wed, 10 Feb 2021 02:48:45 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:13338 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232936AbhBJHqg (ORCPT ); Wed, 10 Feb 2021 02:46:36 -0500 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4DbBby1ZLgz7j4v; Wed, 10 Feb 2021 15:44:30 +0800 (CST) Received: from localhost.localdomain (10.175.102.38) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.498.0; Wed, 10 Feb 2021 15:45:43 +0800 From: Wei Yongjun To: Hulk Robot , Saeed Mahameed , "Leon Romanovsky" , Jakub Kicinski , Parav Pandit , Vu Pham CC: Wei Yongjun , , Subject: [PATCH net-next] net/mlx5: SF, Fix error return code in mlx5_sf_dev_probe() Date: Wed, 10 Feb 2021 07:54:17 +0000 Message-ID: <20210210075417.1096059-1-weiyongjun1@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.102.38] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Fix to return negative error code -ENOMEM from the ioremap() error handling case instead of 0, as done elsewhere in this function. Fixes: 1958fc2f0712 ("net/mlx5: SF, Add auxiliary device driver") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Reviewed-by: Leon Romanovsky --- .../net/ethernet/mellanox/mlx5/core/sf/dev/driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c index daf63a8115e0..c4bf555c25ea 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c @@ -37,6 +37,7 @@ static int mlx5_sf_dev_probe(struct auxiliary_device *adev, const struct auxilia mdev->iseg = ioremap(mdev->iseg_base, sizeof(*mdev->iseg)); if (!mdev->iseg) { mlx5_core_warn(mdev, "remap error\n"); + err = -ENOMEM; goto remap_err; }