Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp349126rdb; Thu, 30 Nov 2023 06:32:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHbd5xnYSO6wUduJvoKE4pnfM/c9WtkhRyUtcLSYl/V0CxLqTYDghq4ZzAIb+fhJAgWrzA5 X-Received: by 2002:a05:6870:a113:b0:1f5:b5ca:435e with SMTP id m19-20020a056870a11300b001f5b5ca435emr26165390oae.52.1701354749231; Thu, 30 Nov 2023 06:32:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701354749; cv=none; d=google.com; s=arc-20160816; b=OKqKODpstoaeZZb3We5h693EQpeWBZk0p0FJqgModuYC6LQpLmy4Mcx0piNXt1gCGX ZJX3jU3phmJ5FXw5FKq5ThZvhQl9Ng9eLmMrglqRIMuIq3lTuXRUZdIfPKf3En3fKfbZ mFPqR2dytIFWtw4pWBObfC9YFQIoUH2n+E7awxUh4c637J3zxrUKc9jVtufxsElxCSdR jCnqsAv1jvxriZdP9bcuDYqQACfh59g5ZlJ5K1XPA2MTh3QqIo49XkHOO9iq1gbBhwCc AvYuVoTb5I1IiKH2Jzi/+mpbNkRRESOkU61xjG+gIywe1OrFsh5ROOyn6Cm0+8qrVycg vnsw== 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=y/0+Wn+8AjFaSRXEmSpjlNVW3aUsGbAtUXk6uLsTtZM=; fh=3HT3Bz2ya4fyKxg5RszywYuFwbb50v5KP1KAp0Lm7kk=; b=szckoYyvoZwYff6qfL/bcvIigzBLgvz1gfs5HrnyHt+BtaCxyUGQhpOb71RchKqHhM xH1HpNrfeI89QQ9T2/zSnHtlxW+swScixXktHLfBjVWVafgDNNr3HFlcTuz2rak9Op4Y 1ynwztKcTY6zTNfiQssLxydhon2KHJ3KjZKHz8EBwViuewbkRhK/S5edfamvXM4+DfCi B59UE4wwPzOiEVV8nbLtQB6P8maJ5NZlxQnm59mg3/hbLLv+GIMkZjwaCgle0OJP7Ued KaRgewGgMf5LDJweUQeULVmQiqNXFIp6jCLV9VedVrnAvLNq/QVhIxDX3EeYjLFMBbdQ gufw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Qchrlufb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id hf20-20020a0568707a1400b001fa313232bcsi445195oab.212.2023.11.30.06.32.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 06:32:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Qchrlufb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id CADA480CE7DC; Thu, 30 Nov 2023 06:32:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232206AbjK3OcM (ORCPT + 99 others); Thu, 30 Nov 2023 09:32:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232000AbjK3OcL (ORCPT ); Thu, 30 Nov 2023 09:32:11 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0805E85 for ; Thu, 30 Nov 2023 06:32:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701354738; x=1732890738; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ew2kPcLfyTuYr73yBcv/Hlg5hDX86dci/VlQ3uXRnrU=; b=QchrlufbQ9Li7H9gTBxf5REqh9bOjgJLLqy7qLfsdcMrQNlTaW1uYJB6 3jjqZgAU+Rg3lfd/kAUDd1V50kRQS9072KfCk7RktWCkZ98BoZmhvk7HZ S0kUFo6C0bPpqLuyYRmMpiJ6avxfbrMs3Mlra/DQL4NdV4kU/eGFcaTe6 s86+7IAjVNIWTCgs5z46uNW8vsqvvwjohvGrklITc4e+V5UaKAdqaCOrH /RrnfEGsgx6V9KssPPQoRP5YRDj4GaUnaHhxhhysM35GkRGs9Hk0cl/un PT8NrR0VlEAug8OTJhxoL6gmVKRIGVUeH3V7hd9RXZoHDX3jGBMNoVE3n w==; X-IronPort-AV: E=McAfee;i="6600,9927,10910"; a="318489" X-IronPort-AV: E=Sophos;i="6.04,239,1695711600"; d="scan'208";a="318489" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2023 06:32:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10910"; a="860210825" X-IronPort-AV: E=Sophos;i="6.04,239,1695711600"; d="scan'208";a="860210825" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 30 Nov 2023 06:32:16 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id B1A56535; Thu, 30 Nov 2023 16:32:14 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-kernel@vger.kernel.org Cc: Lee Jones , Heikki Krogerus Subject: [PATCH v1 1/1] mfd: intel-lpss: Don't fail probe on success of pci_alloc_irq_vectors() Date: Thu, 30 Nov 2023 16:32:06 +0200 Message-ID: <20231130143206.1475831-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 30 Nov 2023 06:32:26 -0800 (PST) The pci_alloc_irq_vectors() returns a positive number on success. Hence we have to filter the negative numbers for error condition. Update the check accordingly. Fixes: e6951fb78787 ("mfd: intel-lpss: Use PCI APIs instead of dereferencing") Reported-by: Heikki Krogerus Signed-off-by: Andy Shevchenko --- drivers/mfd/intel-lpss-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c index 8f5e10817a9c..4621d3950b8f 100644 --- a/drivers/mfd/intel-lpss-pci.c +++ b/drivers/mfd/intel-lpss-pci.c @@ -44,7 +44,7 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev, return ret; ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_LEGACY); - if (ret) + if (ret < 0) return ret; info = devm_kmemdup(&pdev->dev, data, sizeof(*info), GFP_KERNEL); -- 2.43.0.rc1.1.gbec44491f096