Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4517490pxj; Tue, 22 Jun 2021 01:59:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrwjdAR4SXm22eFhH+xMWm6xs56ksSu3XE9W2gjpyeFchdN70+TfUr3fytRoxJ54JSmbtS X-Received: by 2002:a05:6402:40c4:: with SMTP id z4mr3507002edb.364.1624352358136; Tue, 22 Jun 2021 01:59:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624352358; cv=none; d=google.com; s=arc-20160816; b=FTNdqWsryfvOxnaRa7a7vbohpBm/00FGECQ316S/rTSqUeXkj3OekpPE30mAz35/iK 12kuucQoael7UOdW/1qvfEneADTFxKjO1EEjRPdXbWG6ekqKeLCCSULTZIheLkR5KNYk pXqjeJi22riHCMhltMs2Qp4iI6fHnirgqzhLCEPeH/bLjP87H+l9JfPty7QA0wBfIxV+ aU3hDCkv/uEWqBCGKWpPMP8hoI0EAFdlUxLKOEAXwFUUZZqE0KlI15HYYz4fOx3K3LoR dEZ+T9Aa84wp2rNnHMzYe+k9E175u2tG8nstsc8A5nxaO6be7V2RZQ9GdePis/KAmbJq UwEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=21zli5to4bbxRV7+kJw7X/mPMQyWrvlyQpneffahFWA=; b=k81Hs3OLnaf8ZJLx5ENiXe30NkR3JcSw9x2UO6H/ApF8eqV748nPGtVgVBBZzFZzYJ C64McqQSqOiCH/DpJNBcNIp1JEP/mt/G/nv1OkHG5Pb0bW7BUKU5hCdqdK9YuYjfO0qq nj2qlzWmGl47n5ibQTLVNOqbxGcLWUwdPojgDWpHWNUzuArzj3OsigwXyjP0RpaY1X3f sE0eqVUgMuIERoYyJC3fnE5S2Y5dejoAluXYRAOhOychsSGw3YPtwcuvJFh6ChZToa3u pcoFHuo1RBfsdOVQr+UDM7rZLcPHEfUUWcA6pUhKv03BRTmCOs6hkSUqZ8S53zJ0No3K byng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sGTaSxek; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g13si2021679edb.248.2021.06.22.01.58.54; Tue, 22 Jun 2021 01:59:18 -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=@gmail.com header.s=20161025 header.b=sGTaSxek; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229754AbhFVI77 (ORCPT + 99 others); Tue, 22 Jun 2021 04:59:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbhFVI76 (ORCPT ); Tue, 22 Jun 2021 04:59:58 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD4D8C061574 for ; Tue, 22 Jun 2021 01:57:42 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id x21-20020a17090aa395b029016e25313bfcso1857747pjp.2 for ; Tue, 22 Jun 2021 01:57:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=21zli5to4bbxRV7+kJw7X/mPMQyWrvlyQpneffahFWA=; b=sGTaSxekFxwVB371yT334il4P8+Ob1toaq2oUzG31a6GaDMTA+F46WmZgq2rbGiw1V oWrqn1+UkmJATtKgRjmHPpV339N+3L1TSPVKdCYpDhHgFQABde8lxBLaz5/n+4J1+fZ9 6KqLDeKIb+adVLw6ZfQTQ7E/UzyuD/ys4pkAC84Rkdf/Ub/1c9eRcdcNRj3ZkxVQHrmM vd7Y9Kmwq5kSRQXkV0yfhF7ZagGizYIT69aZzvEiAO4lBV05xjZN2ckiaXRQWJPpJoIh cEUL0vABeS/v2GtUIdVF/y8MeV1tZA9VAAe0jYwtZsxcyWS/XZrb+ggYz3L0p/R3cyXv ys2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=21zli5to4bbxRV7+kJw7X/mPMQyWrvlyQpneffahFWA=; b=F55KYieshEzsmjrt/JrhzCxnsatmeSDL9VQFaoJkm8ctoHZ0Ql5VKK3o1oaffBtoTe Fu4cdleVLqvOHc5RN/XGwIUkAfTtd/CraIfY2+juQrHzVQ6aROg8W8O8Nl0aRkDERLhQ yRhd0kEhtBV0tCes7mS6iUn5dEaO3gFZKXlTyfYDmcQcJ/8/EiOXX0F6i5fT+7OE4EV2 Nkrk9uFR0UYcDIETfaxKPi5FxKS62HplCdXvilFbH5onFRfPzjwNV2IwzF9zUBs7reYg Fw32Ny9gRZ2giLRbQ1ObN7rVWkug4W+teKDcIeTG6+hIgjTRgmBfMGUJ28gi69BtbTzm GPyw== X-Gm-Message-State: AOAM532oVt5I2YpephS7HqvI74wow7ke6Zu7CAl8lpntRZJ2kY9/yxAw fswY3+u/pQL9o4sqrkKFXQ== X-Received: by 2002:a17:90a:8e82:: with SMTP id f2mr2952781pjo.177.1624352262155; Tue, 22 Jun 2021 01:57:42 -0700 (PDT) Received: from vultr.guest ([107.191.53.97]) by smtp.gmail.com with ESMTPSA id l12sm16941506pff.105.2021.06.22.01.57.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jun 2021 01:57:41 -0700 (PDT) From: Zheyu Ma To: mporter@kernel.crashing.org, alex.bou9@gmail.com Cc: linux-kernel@vger.kernel.org, Zheyu Ma Subject: [PATCH] rapidio: tsi721: handle errors properly inside tsi721_probe() Date: Tue, 22 Jun 2021 08:57:19 +0000 Message-Id: <1624352239-6179-1-git-send-email-zheyuma97@gmail.com> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org BUG_on() is a too drastic measure, remove them. Instead, just output error message and exit. Signed-off-by: Zheyu Ma --- drivers/rapidio/devices/tsi721.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c index 4dd31dd9feea..92ec5081e5fb 100644 --- a/drivers/rapidio/devices/tsi721.c +++ b/drivers/rapidio/devices/tsi721.c @@ -2851,7 +2851,10 @@ static int tsi721_probe(struct pci_dev *pdev, tsi_info(&pdev->dev, "Unable to set consistent DMA mask"); } - BUG_ON(!pci_is_pcie(pdev)); + if (!pci_is_pcie(pdev)) { + tsi_err(&pdev->dev, "Can't find PCI Express capability"); + goto err_unmap_bars; + } /* Clear "no snoop" and "relaxed ordering" bits. */ pcie_capability_clear_and_set_word(pdev, PCI_EXP_DEVCTL, -- 2.17.6