Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp606480pxb; Mon, 25 Oct 2021 14:50:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJri8H7SPz03g9c0ky/Wf9SoqunGj9gZJpBQNeboSQbNiabr6iDHb7iIQ547i0StMxpZLM X-Received: by 2002:a17:90b:3ec6:: with SMTP id rm6mr38552805pjb.27.1635198627445; Mon, 25 Oct 2021 14:50:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635198627; cv=none; d=google.com; s=arc-20160816; b=VbsdhEgebct+/PT0BeT4GuV4VrWilq3dx+6ejUvUD23uZkdr8fSydX3rEetn3OJ0za 8Xi1Hktdt/qZT7r4BkzRdTvXXfhrCOk2+aZlG7rgABgCo9cBJ3PXMmDBm5uzcjEV4rRg oH1lZGeBcgJ08o7wnk8UofVWRl30OgqYrm2Alrk7TasWd2JxwiVxFNLQBT0meGW+FCtG f+eyOSVrTP2lHiPHpT8u5XuC3tFdxK0CtdLCIH8IsTGQp8hr4JKZfRo0yz36eIW28QNW b7Sv0E4FYDiSaF/a9msLucrlI0RObkSLW9diWM8CO8Tduh5O7LxdpdE/6hY/r0GAdt/y a3EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=R9XtlDIyCwxTJV0nOqWitUIEtha21YcKgGzfYMlfQo4=; b=jR6+bLDKBEIpndsN+An+XtNlNlvwa5e937UQI29C2Mpu5GvFSymMHPgkvgQwxM+VTH RlhksskmpZFJ7Zoy1LMwc1vjwZG1HHm2cOfBfxlFyaQ0mkU60E+Sb+HA9pvPh3GR3kwZ O3fYAMJ8jSVyMvJOnMabag0+zj+FPzSTUTy/lV2xnruRgdrd5ANush+ESy2V4F2jByWj 9Z2dN/DFdmWdn0np4Nj5PPLmGgYHceoCLVrljv1MVKk/UQB2EnoCPjMEvLQnr6jg12wD lP5wrBAf/J1S6igJkuHkCXoppQwdxX0c1aSbhqGxA4XA6lm1WxD6UGypYKMevreA6UDP 1VBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gOTme8KK; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z15si24519221pfa.99.2021.10.25.14.50.14; Mon, 25 Oct 2021 14:50:27 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gOTme8KK; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234358AbhJYRDV (ORCPT + 99 others); Mon, 25 Oct 2021 13:03:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:55020 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234266AbhJYRCf (ORCPT ); Mon, 25 Oct 2021 13:02:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5D23D60F6F; Mon, 25 Oct 2021 17:00:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635181213; bh=vvG536PuQUxV1m0gedO+Dn40TcRnR3gq2Q4ZLdq1GPo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gOTme8KKfInnYcOFppVBFgpsT4duCtoEggRwyKyRchVBbT3z1zquCz7/yC71hoAW6 618bVIaHBgkgawj2+GsTYhg8Wj/gq5RDp9ayaF9w9BbTT28xHz9qBI9pppWfU3+xzi I8+yR91DTkIuvcQm74M+JoDAMWBfjl7jGN8y3r4qcDsy+WvMfrwKk2570/Iz9Z4Bog tQiydKE9J4s0K56e1gY/40Xt4IkbLDhGuueM3ZGm7eMNCCrq1LxXYFuXkWubcZuD6b OBRdok/QrxZNXQBXkhT4M8OyBJaRn/A4EqKAQfTtbLTFsLNH+1OqqbHnTyDtydjEoG z9HdEIu1LBTZw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Zheyu Ma , "David S . Miller" , Sasha Levin , isdn@linux-pingi.de, zou_wei@huawei.com, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.14 12/18] mISDN: Fix return values of the probe function Date: Mon, 25 Oct 2021 12:59:25 -0400 Message-Id: <20211025165939.1393655-12-sashal@kernel.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211025165939.1393655-1-sashal@kernel.org> References: <20211025165939.1393655-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zheyu Ma [ Upstream commit e211210098cb7490db2183d725f5c0f10463a704 ] During the process of driver probing, the probe function should return < 0 for failure, otherwise, the kernel will treat value > 0 as success. Signed-off-by: Zheyu Ma Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/isdn/hardware/mISDN/hfcpci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c index e501cb03f211..bd087cca1c1d 100644 --- a/drivers/isdn/hardware/mISDN/hfcpci.c +++ b/drivers/isdn/hardware/mISDN/hfcpci.c @@ -1994,14 +1994,14 @@ setup_hw(struct hfc_pci *hc) pci_set_master(hc->pdev); if (!hc->irq) { printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n"); - return 1; + return -EINVAL; } hc->hw.pci_io = (char __iomem *)(unsigned long)hc->pdev->resource[1].start; if (!hc->hw.pci_io) { printk(KERN_WARNING "HFC-PCI: No IO-Mem for PCI card found\n"); - return 1; + return -ENOMEM; } /* Allocate memory for FIFOS */ /* the memory needs to be on a 32k boundary within the first 4G */ @@ -2012,7 +2012,7 @@ setup_hw(struct hfc_pci *hc) if (!buffer) { printk(KERN_WARNING "HFC-PCI: Error allocating memory for FIFO!\n"); - return 1; + return -ENOMEM; } hc->hw.fifos = buffer; pci_write_config_dword(hc->pdev, 0x80, hc->hw.dmahandle); @@ -2022,7 +2022,7 @@ setup_hw(struct hfc_pci *hc) "HFC-PCI: Error in ioremap for PCI!\n"); dma_free_coherent(&hc->pdev->dev, 0x8000, hc->hw.fifos, hc->hw.dmahandle); - return 1; + return -ENOMEM; } printk(KERN_INFO -- 2.33.0