Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp576905ybj; Thu, 7 May 2020 02:40:38 -0700 (PDT) X-Google-Smtp-Source: APiQypKp/s27YBu2sUfdkbcIyXuZfhJyWK5SqYIDFEhIXOz5pFSICECO0usefY//fHofvObqmZPo X-Received: by 2002:a50:c3c2:: with SMTP id i2mr11263916edf.227.1588844438283; Thu, 07 May 2020 02:40:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588844438; cv=none; d=google.com; s=arc-20160816; b=EosbKfEvmz6VECzlFOorEMGxqUeY4MLphIUE7pcjNYREiDVKS41993wi9AheWynbbm TmtLlk6bNfyWo+F+D0LWcjQQ8jNiNs/vR+lo8FkCTQDIEVR3pr1XoyMehNDNVfh51Xhq sKcaOppAL0rOriNcSnNYpYKxf5q8vKEml/6zeWJQmeK19XEwnswWAktN5LLVIl/pp3s3 bw5mp9pZBHQNWr9Lc5Th0faduwJlJtDa78MkkfgKc2Wnn7iQ7iBTFL+aL6tiAAEr5Mm/ 1awzC5esWy1d+m9oxCpdUM0YtD7YrdD4BF+qWO+vdCJPPyjpKasl74L1TWm+kUOxKCec qYSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=TCobxdYpqjx0LE+KACSj2+DWyv6fx2quhzG5XZP+gq8=; b=vUaI8ULiPn1IYPsvA09/MLHd4ZixqLApoPagFPu34Bnrh3dsTfq5ZIPaZWctDSOkJk lqbecZwPXd6mnXtqY8Yn0BPNuF0yaPvRizy3L/C1a0I5bpD3PxMh9soBhFhQ+nDAqCte /FnZQXHpdZFMFS+3eC3jRUJed3T/tF8u6BqOXkoS/Illj3oOsGMA4Q6rbpD6NTeXeo3r /uQVIc+yjnmSd/6NJtItZ3uaE51YU+yJ9SmB6bz4oNecl69nTtkJydpEvxozVJsUWln+ 6LCCLjHVZ66jEOEh5H0nz0lUydhMSYZO8P/XahM1MGULVmABMxYp3FVKbsdeMkPy2aoA n+4w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oj22si1801776ejb.458.2020.05.07.02.40.14; Thu, 07 May 2020 02:40:38 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726222AbgEGJir (ORCPT + 99 others); Thu, 7 May 2020 05:38:47 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:53764 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725809AbgEGJiq (ORCPT ); Thu, 7 May 2020 05:38:46 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 482F23FCFD658AF0AC0D; Thu, 7 May 2020 17:38:44 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.487.0; Thu, 7 May 2020 17:38:35 +0800 From: Wei Yongjun To: Samuel Iglesias Gonsalvez , Jens Taprogge , Greg Kroah-Hartman , Zhouyang Jia , "Kees Cook" CC: Wei Yongjun , , , , Hulk Robot Subject: [PATCH -next] ipack: tpci200: fix error return code in tpci200_register() Date: Thu, 7 May 2020 09:42:37 +0000 Message-ID: <20200507094237.13599-1-weiyongjun1@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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: 43986798fd50 ("ipack: add error handling for ioremap_nocache") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun --- drivers/ipack/carriers/tpci200.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/ipack/carriers/tpci200.c b/drivers/ipack/carriers/tpci200.c index 8a9c169..b5eec18 100644 --- a/drivers/ipack/carriers/tpci200.c +++ b/drivers/ipack/carriers/tpci200.c @@ -309,6 +309,7 @@ static int tpci200_register(struct tpci200_board *tpci200) "(bn 0x%X, sn 0x%X) failed to map driver user space!", tpci200->info->pdev->bus->number, tpci200->info->pdev->devfn); + res = -ENOMEM; goto out_release_mem8_space; }