From patchwork Thu Feb 8 10:17:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 198275 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp67733dyd; Thu, 8 Feb 2024 02:20:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IE4eqNdwQTqxPttq3Tv/mn9H8YUSsNYPEQWAsEMxkECpO6eR+i46Q0psi7wyFGwAve9wo6W X-Received: by 2002:a17:90b:1d0f:b0:296:c0c:98f5 with SMTP id on15-20020a17090b1d0f00b002960c0c98f5mr4961622pjb.40.1707387601807; Thu, 08 Feb 2024 02:20:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707387601; cv=pass; d=google.com; s=arc-20160816; b=cPJA6R82yTyfJnCsetwh34j95rnS8jRJyiWrrNOTuYqP0elvEz3L61cDIYwfrmRNKE 46ZcFdQkeKrUQoP56Nxh39JfXCgnJ5jrRLhOy19Ef+UbzN0WCyBiAudMnEsmBEcLQWfM htqX+aLMmKCCQ1qUVsifB5y8d/zYU/o0IFw1wG8aBVmHT3bTaXr4f79Q12Yhkb/CymQe tzpd98ignnvb7W69SfFgFmDZegvgPaC/RfID77uxJIHx4umD/o1acCetEI6+HKi5SfIQ PFtyA6t2ua1Q8qCurAOKE40MylaoaEDR53Uf7ssXEQgMla1pawZZ7RP1TP9OM1utRsOo UayA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=dSCzA3TtajxFSnQT41yvEgUpa+RWk4jWwMsKck/Sxug=; fh=pvP6iK5O0hifSaltBLvAnjMKAUT0ACg4Uxys/5CnUOA=; b=Xk1OPHu91NIiK9Gzwa/ZWHmWowQUe9VHKbToJk2k/U0s3V/qhk5XEBZrozq21j2HEO OWyYLv4KmU66SG9HDmZTN9uhGFFcJgGLjR5J5JO2uh4rqWn57/NmUfG/dhv6xkE1Qfkt Jx353mi6TgblXidkkoJsERWtjZ854UaVD4nuBPrnrjpevxwXHBlALQCO3ocyQ0NFe5rx eoWyaI3B9GDtSrAz7GKtxcgy9uhA6ur0WAUL5R7KdAIGpaT6I5M/wP1nB330Pn7ZGYvd pdCxC5ZjwiyhwFDdUF7ikq7Jde8wRV9FEjpPAUYvY+uyFWR+L+ir2xKm9CN2f/NQ+1qy vPrg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ohd164C6; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-57830-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57830-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCWA+uzfvVcypedwZ3jAm49DBP4nE98964SykRlnK1hv/I4TACWqVvZYvjqFwBH3kTeik/ev7zVSZtliuXa3hCQpmF0DBg== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id v6-20020a17090ac90600b0029601fcbeadsi1020569pjt.114.2024.02.08.02.20.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 02:20:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57830-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ohd164C6; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-57830-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57830-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0BD3828B976 for ; Thu, 8 Feb 2024 10:17:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A767E6E2CB; Thu, 8 Feb 2024 10:17:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ohd164C6" Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B79E6D1AC for ; Thu, 8 Feb 2024 10:17:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707387433; cv=none; b=nUSWR7INxjOGMGnBhk+2eC7kXeC1XtlicY9XmkDvRZTT+0kXXakcU6DeThpu2KchTPd043KfvuoEKzxjv7nz5YElwPO1PqLu6PBVxLvhwoZOw35rVGdBRqRLww0jgezRuY1XaqwuA6YSKxI0uVwTpv3HRR1l0i86kSCzX2W9hY8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707387433; c=relaxed/simple; bh=84Kib6khEPlN8l9DaFkQuhMzge2xCeFF//MaGpJ0yqE=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=mB1F0OzuAtj/czdTEV15UOyZYhmoUX/g5yXGrZNzd+YeLJKNW77aOARYSW9ubHUK7XhRHNxXGZSYLBMOiey1dlEd45GiHbnQ2IOfCpPyWM+GwGy5AKMELcjSkYpBKmOZhpgWJ6k208VCh93LnTilFdXZZSngHwCy4KSnNNxHKWk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Ohd164C6; arc=none smtp.client-ip=209.85.218.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a37721e42feso202430566b.2 for ; Thu, 08 Feb 2024 02:17:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707387430; x=1707992230; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=dSCzA3TtajxFSnQT41yvEgUpa+RWk4jWwMsKck/Sxug=; b=Ohd164C6BH8Uaj+0a5Y2EKVdnqMdDhih2l5mC7BszLEdGIdeGXZ9QTops3R3wgC843 vRYNMOOl4s9Be77sSjKNwEPuPCiXUkywsXGbjvFtLHlmdYDckUjDWKr4o/UkDMqwvpu9 1uTQCA9DURbM9OjxVw7ExhHjwPOwv4G21HzUNmp9qqDvy9U1dhwlzYi3FcXRBbth1T4w 8VXzP9HFSN6DBoejpp5IIiTnRLYYrmVB7Ti4kNLaSym8mqeoboyGHQKC0y0N7k2wtNXT IW8v1ARIGZZwMLOSN0JCPWS6bTM36GJ9KuAUwnsYPyHfwSxizhbKC+fARSndcfk684Eq xsfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707387430; x=1707992230; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dSCzA3TtajxFSnQT41yvEgUpa+RWk4jWwMsKck/Sxug=; b=rxJ58w829lKYJY6EZCGE+huyzcye+6U3rHsjkBO2woCjlV3utec/aXmoxj9usMJfB+ cRpPuLpO87QJXJb9uTn+NZFHF1kbIV3tXR0yhqVlnlKSSsRdZA0UI1OvwHu9jwcWXnWe xYAs5Ixij2vgUtq5uN7sCFXfjVC9iQVLi0YXq3cLz1EnC0jdtR5+LTk10mT5q9ak8wyW Lly7by468eERBAESq12Ak2iRVRwapOYIiDLVqMHz+l2QUZHpF9+wC12xKUYk239tr3Lf 6VouKMTGds5cBxLHe14fOUNBGbKILIXxba/Uxut83jOCxeEqqEB/TKFQyUI0g0hZ+GuO uvZA== X-Gm-Message-State: AOJu0Yyz6bpyml51FAy0cRBUOQjv73vL257PgX6YZRgEOPMdbb5gLRp1 Ml4ZQYLhy+IBqydUSkgyVGuwfuZiwLN3GEIZdZUhN0Bel7FvNgbou1aCllCPUMA= X-Received: by 2002:a17:906:2111:b0:a38:406d:5dd4 with SMTP id 17-20020a170906211100b00a38406d5dd4mr4575288ejt.36.1707387429815; Thu, 08 Feb 2024 02:17:09 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWqKVQGhK8sUJu0fES0yOgITDofk1UNiJVOH8Sce42i+S+Uy+ns0sufGciH3z7L+1Wi8Xtd4BcYg90PvaqaQ9XgN0K4DBOufSnPjP0uhvngcvJxwJhXWWAfBrouK3T7SwF3fH2ddn46GGMmXAPqJpkyJ7BBlo56i7pOu+fCawbVtltmcOVyEhcReg+dEYcZVwHqnj0YiJnBjqCKGYtLyb7BF0Z3rBGOTDe2DXu3ipoE2vUIMllvEluJXkBHivuCJFLYDV8RUNhtxO8JuooiGJftmo8p0NEkQ36ZYloZ5+VyIQle2yANRoMWWvmOPLPahmnddFAw1W+ZReF377+bC6ApoM7C1qqywfdKE9FfkFFEDu/w/5xaLeU1y9HRCNW9kgGiQvAyIPry7YhAKz/vrs5/LFnF4ApCZHd9JTzmwRc/qlA= Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id vo3-20020a170907a80300b00a381eea0e9csm1736957ejc.197.2024.02.08.02.17.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 02:17:09 -0800 (PST) Date: Thu, 8 Feb 2024 13:17:06 +0300 From: Dan Carpenter To: Luca Coelho Cc: Miri Korenblit , Kalle Valo , Johannes Berg , Gregory Greenman , Alon Giladi , Anjaneyulu , Daniel Gabay , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 1/2] wifi: iwlwifi: Fix some error codes Message-ID: <9620bb77-2d7c-4d76-b255-ad824ebf8e35@moroto.mountain> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790325661716505125 X-GMAIL-MSGID: 1790325661716505125 This saves the error as PTR_ERR(wifi_pkg). The problem is that "wifi_pkg" is a valid pointer, not an error pointer. Set the error code to -EINVAL instead. Fixes: 2a8084147bff ("iwlwifi: acpi: support reading and storing WRDS revision 1 and 2") Signed-off-by: Dan Carpenter --- drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c index 9afb1b1d6aea..506279b95442 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c @@ -475,7 +475,7 @@ int iwl_acpi_get_wrds_table(struct iwl_fw_runtime *fwrt) &tbl_rev); if (!IS_ERR(wifi_pkg)) { if (tbl_rev != 2) { - ret = PTR_ERR(wifi_pkg); + ret = -EINVAL; goto out_free; } @@ -491,7 +491,7 @@ int iwl_acpi_get_wrds_table(struct iwl_fw_runtime *fwrt) &tbl_rev); if (!IS_ERR(wifi_pkg)) { if (tbl_rev != 1) { - ret = PTR_ERR(wifi_pkg); + ret = -EINVAL; goto out_free; } @@ -507,7 +507,7 @@ int iwl_acpi_get_wrds_table(struct iwl_fw_runtime *fwrt) &tbl_rev); if (!IS_ERR(wifi_pkg)) { if (tbl_rev != 0) { - ret = PTR_ERR(wifi_pkg); + ret = -EINVAL; goto out_free; } @@ -563,7 +563,7 @@ int iwl_acpi_get_ewrd_table(struct iwl_fw_runtime *fwrt) &tbl_rev); if (!IS_ERR(wifi_pkg)) { if (tbl_rev != 2) { - ret = PTR_ERR(wifi_pkg); + ret = -EINVAL; goto out_free; } @@ -579,7 +579,7 @@ int iwl_acpi_get_ewrd_table(struct iwl_fw_runtime *fwrt) &tbl_rev); if (!IS_ERR(wifi_pkg)) { if (tbl_rev != 1) { - ret = PTR_ERR(wifi_pkg); + ret = -EINVAL; goto out_free; } @@ -595,7 +595,7 @@ int iwl_acpi_get_ewrd_table(struct iwl_fw_runtime *fwrt) &tbl_rev); if (!IS_ERR(wifi_pkg)) { if (tbl_rev != 0) { - ret = PTR_ERR(wifi_pkg); + ret = -EINVAL; goto out_free; }