Received: by 2002:a05:6a10:87d6:0:0:0:0 with SMTP id g22csp837362pxr; Mon, 11 Apr 2022 08:24:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtC7OsBYT9jH0RFaYpZsvgL8PD7Tvk8mz+fDeW07accp+EkTMa6qopXt/B/lpCkpDuQb0b X-Received: by 2002:a05:6402:3595:b0:419:336b:29e4 with SMTP id y21-20020a056402359500b00419336b29e4mr33847224edc.63.1649690677235; Mon, 11 Apr 2022 08:24:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649690677; cv=none; d=google.com; s=arc-20160816; b=JDp90O0DkNd9RGJrzCtfcNGchQHch7BTwMDcZwMWApsplY2FA/f9euryxapEDyEgeM 0J1Wuwpcdnq0eDcFQbAyw3nE0TasrpddhTrM/5rrNoKVofYSRhaT9Mzahp/6oJlIMh2B 18EODCmPxa80xDQHrjagoVkEwKhKry5siZmCSqtHng9vy542GOgkoYAevZG5CFqhPcN5 yj3kUrYjKa5fbbM6dryn/h6t1FeP2gnwlmz/8P+4g5VOD4qGPa95C/6fPEmAGHUffnAj ar1UcBBxIq05qiXZpP0EYyJmqr2Z60ZRKYmpIyOXxg11VAy+wWegNqZMqY+s+RfeOKS5 Tmhg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=eQxR8LoSXw+Q4PAtREmzhoLUOa2AwuVcoHE/IZiDWwo=; b=PZGhUHlMqxaYB9kltCbD4Vc7r8VVFrkJnRTnZWpiMw9W9jQhdG9c+Bj0PkuY0qXD7V msFLEJ3DUZi791jUkvqlHH8tPuUgaSYHB6+1wyDcus/MXPjai4MFwj3gDzbX40/lslw1 KlmaXl3QPbK6Od4jlj71rrGUbYDq93af7QbW8TsnTv6k30qBIe6mmK/TvTLqPlu4Ywt7 eaD6SZVovvBKSQFhlE7SzErzH/MdbfXexwxu4D2MzTPIHolI+GVLooqh6EOkbnYQqoz1 7u2k4lQihDSxz9OjAppidwGj7NZNx7IGsXbP5+C8e8zhaFTbAjYZ5jKhfNio/wPcwdot aAng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IuMzyrwp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kx25-20020a170907775900b006e8439b41d1si3353333ejc.69.2022.04.11.08.24.12; Mon, 11 Apr 2022 08:24:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IuMzyrwp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S242205AbiDINvw (ORCPT + 99 others); Sat, 9 Apr 2022 09:51:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234964AbiDINvv (ORCPT ); Sat, 9 Apr 2022 09:51:51 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D32FB89; Sat, 9 Apr 2022 06:49:42 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id q36-20020a17090a17a700b001cb57a8da1cso2138668pja.0; Sat, 09 Apr 2022 06:49:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eQxR8LoSXw+Q4PAtREmzhoLUOa2AwuVcoHE/IZiDWwo=; b=IuMzyrwpKYrswpduJZP0e2v1e2zKNVxsEMo7zglDLrCW5PVCTv97+MFqE9iyDzECza cZxFReHSImiGf8FJoF9/9BzZprLuhkd1bEA77Di3qatxal974webxUPlND+x/j0gLcGC 5NLAsWyODgqonR15Al3w6PBlaY73c1ISCLByRCzn9Ym7jw3C32JxYsS9N9mR7hdFVVUG 6/9qlMVGmjozwidXrq+wkjmxQ3zsXvKGomEG3Se1KJ9K9ef+bj0OJUPQxO1r3qJ5zQ3h jK8QIpFY7H0Y7Zk0dTg/bZjCIEXjnFGRW1HQ5URr4XDPVDl2i7vXCxk6ooIgnPs7DvUG 6xPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eQxR8LoSXw+Q4PAtREmzhoLUOa2AwuVcoHE/IZiDWwo=; b=tnE01Fv50uMasQWz2HhTXzOnTSGavIpUOlgSOPp1BXPCyyT00Tyz9/Vf2kZNYlXWJV hqr/lCpbYz7rUVfPU1PclKaeSkIN5v7LGJbxZy2pPPBhohJl3YFb+/VNexfuH5LXnQ+B XNHipTRH70mv8S6VA9cDsAqQ+RfxXmFlt8pgRCUr6l+qz+UyWMT/Eidruwyqzu02c2gq re0cq/hIB3kxGCmrGaPELh4GiymUOYuiKywVl7XcxDRU5ONe+1I7op3Tilu3BadPAbsl eSxo7Fdmyz55MavAF7ZK0hTQidV2WhIv/RGP5n3A3bZGuNH7ww0sjV7LQ4nd1FrsU9OX vIRA== X-Gm-Message-State: AOAM530Gza2I6y2RxX3tYT7WZkKwjiyiU58RAwaxXd03HJZsrNQotITF AW3rLk4sGfUkT/iMLGX8hw== X-Received: by 2002:a17:90a:c792:b0:1ca:4d2f:3f1b with SMTP id gn18-20020a17090ac79200b001ca4d2f3f1bmr26762255pjb.86.1649512182026; Sat, 09 Apr 2022 06:49:42 -0700 (PDT) Received: from localhost.localdomain ([144.202.91.207]) by smtp.gmail.com with ESMTPSA id q18-20020aa78432000000b004fb0a5aa2c7sm30964774pfn.183.2022.04.09.06.49.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Apr 2022 06:49:41 -0700 (PDT) From: Zheyu Ma To: sathya.prakash@broadcom.com, kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, sreekanth.reddy@broadcom.com, jejb@linux.ibm.com, martin.petersen@oracle.com Cc: mpi3mr-linuxdrv.pdl@broadcom.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Zheyu Ma Subject: [PATCH] scsi: mpi3mr: Fix an error code when probing the driver Date: Sat, 9 Apr 2022 21:49:26 +0800 Message-Id: <20220409134926.331728-1-zheyuma97@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org During the process of driver probing, probe function should return < 0 for failure, otherwise kernel will treat value >= 0 as success. Signed-off-by: Zheyu Ma --- drivers/scsi/mpi3mr/mpi3mr_os.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c index f7cd70a15ea6..240bfdf9788b 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_os.c +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c @@ -4222,9 +4222,10 @@ mpi3mr_probe(struct pci_dev *pdev, const struct pci_device_id *id) struct Scsi_Host *shost = NULL; int retval = 0, i; - if (osintfc_mrioc_security_status(pdev)) { + retval = osintfc_mrioc_security_status(pdev); + if (retval) { warn_non_secure_ctlr = 1; - return 1; /* For Invalid and Tampered device */ + return retval; /* For Invalid and Tampered device */ } shost = scsi_host_alloc(&mpi3mr_driver_template, -- 2.25.1