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: 771260 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (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 A5A136D1AD for ; Thu, 8 Feb 2024 10:17:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707387433; cv=none; b=j7T6iXUEkHgmp/wmmxUzsUtL2a9G9jYuxsrPZWqk1Gq4oV1+dTqF+ZnPTHMLKyvleWTKLg4HIQGSmS1kiCo3Cc4xGoOTATKGvNMmiHPpcAlMRjgnzwwQ4FtB6MWb6Gw1noVBhqkwFGvDidKurIExpOqLo/OZJlgUzcQ9SBq8MRM= 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.46 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ohd164C6" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a37721e42feso202430266b.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=ajk9s+gmKCWbZAOdEDyCvmK18Fzzh2pvsP1fs9QtwRrLLFSajpjEBuUUg1yszoUYbq QK72FjQh5NmCMCZcv8cu0CGPx71/2y1oQqpBepotjl1oMF3sGdGRzaJ4Hdhe8S4X99B9 wV7Ng5XtMcUkB/PSmy2mUlaW13+WhzfT+5KK6iixMcLO6dcLHeFzZCW5qWjccKh1xdLy uf7V1pMhinn72/qQiqB0fRd1f2WOmFPWfhqFzfSzp6MU2peDfxNZFsUUJfqhIVTifaHd tnc4fkDU1l+XHbMuuQ+FZ+MKMXJL9poAGsUkyUvIIkKN73mRKrmFMqjvyTFDnRj3xjCd 7tug== X-Gm-Message-State: AOJu0Yzgii5BDwgfQip+EmF4CKM7lCrI4gDgYyhR1qFGXACV7OSqBqLR oxf5uOHJq7yFIxYIXC9WfrT4retSKXkUX4NvHeL/0rD3lkaE/PI0DNm5EuQQ2zA= X-Google-Smtp-Source: AGHT+IGoDK7SVa0dMNt4YRGN7S5DNOa0d7ywiVZeynjKlEfCY1x5p53xCugngv+0LbXeCiY5hquXdQ== 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-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding 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; } From patchwork Thu Feb 8 10:17:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 771834 Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (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 836986E2AB for ; Thu, 8 Feb 2024 10:17:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707387458; cv=none; b=LUsmMZ5rMMmNXXy72vfZ+jrqTdFvmCn0smBF2wACbBIX2YWjZgfdOHrqpq0N2sAOnY1mxvTpA0S4iV1mu2Z7lia5z5cnnNhFTo0OP7ej7P2XR5tB1kKElPkuw2wdbvPPCXrkVtTn36tUTMPByNV10zCzBPfWj5m5u+I/GfyZjwM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707387458; c=relaxed/simple; bh=TqMu84p62go2ECAjuTKX5lC7+9a4OPfiRFRt5ZFApA8=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=D3F18oehmpUqtJjIpqqgIk2Ynn/t+h/m6oXSpdJndr4CP+JkKG54DoMrO+w7CEHzNs0QipmUQIq7YGAEJj1Z4fe/ycBwXsGhdQxooBPrkD/fzCNcjlTAZKsv03E8+4nCG3+fSvjYg6GXSWkArLRVPJUaBf423p/5/Zsb+tu3BGY= 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=GDcB4PpD; arc=none smtp.client-ip=209.85.208.42 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="GDcB4PpD" Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-5601eb97b29so1401019a12.0 for ; Thu, 08 Feb 2024 02:17:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707387454; x=1707992254; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=mExta14h3FfRuo79nR/+ky5h2A6/maxcVWEMwCpWnDU=; b=GDcB4PpDjORSHT4pBwsomRTCG42odWQd08Y/VyEK0SryNql9mvXetDAqztU95XtA6Z w5FrTrzj/KL1uNPOm5yX6tSZx2K2ePAQEPDEZWYRuzwbo0LVkpw/esW1wIEaVXRWZ5ny r90EAEEaSyWP7yd3Imspbgand6IMjxjqhUcozV5SQ92F8NXRlbmRh1uV2FDG5Wo1YOoH p3vYB4IUzxVnq4/U0Cw3jEGdFbpsVsPWd9S9O3hww5TWnhNyJTcz5DPDVmnS4KguaZJ/ EdUJpgcxJpUFpYafLPLYxRa+65T7e+QujNaoHV8MclshhnPBQ3NQAbzJjXPEMN4ffWV4 DjDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707387455; x=1707992255; h=in-reply-to: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=mExta14h3FfRuo79nR/+ky5h2A6/maxcVWEMwCpWnDU=; b=YUW/oQhqDkBWmzuZdl5PL8oml7afuZNouZ7faSOPCZjRkXF65lQ4A8MsTX+d5VXvce sSASFSNCz3zlMdQWnW86TJ5BNGizuQZwETRjAd/OX0xF/9S/Yu85BOrhlVyv3kPQSEA9 3RbzIzoTEImUfg+QKDIjquXtasptKmJHXFj0/PMZSwZaY3Oy2C7L3LWcPdJ0k2n4BN3P RIwIGvtpqX+wf1jvu9epY9uL+f+WlzlPxJHmirpyMh1acE+z3Jb2a+wH7fFmG+xeNZL4 kSB9sR1jKHBlNv73LMNG2a/TCHFdqU+GzESqqIvqkXy28M0NN2jTcwO/aXNjzNENQJt2 3AFw== X-Forwarded-Encrypted: i=1; AJvYcCVub7cvkc8KUxrPpcNJNAPXD6ldS8Fx90jSuW0JPTfKmc9RdY4E7trDhUQ3Uz4+5WTaLNeXu2LnyxkTxPIJSztkEHtmhrEk53lcbNTc5rA= X-Gm-Message-State: AOJu0YzgvEArATSZE7asDgzXKOVuO5uFBuTmwSr0MtJWL1HnBHPGeEQx gStCQcv/mF51P2/N3yl0op58jhIOZJvHW9kjXy2SsDs8ZPQumjIOSi7sTu8AErM= X-Google-Smtp-Source: AGHT+IFQx6srRh7zgGl8duv2aSjEJvDZQ++1WrbUI0C9W3RKZcrZvqb9vQvs8q9ELhOdvjzgZEUn0A== X-Received: by 2002:a50:aa96:0:b0:55f:ccb4:ec84 with SMTP id q22-20020a50aa96000000b0055fccb4ec84mr2314443edc.1.1707387454717; Thu, 08 Feb 2024 02:17:34 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCU41TDGHT0O3Zd4pv2l8cH4j6BtQDwfNy5O8SMYC/4cRdl+FDAuYn1N4inXencM9KSIJQRYVCXNvB1oqaHfNcwSE1OoL5Eh3mOfdxHndzcI8lPsXHUg6W5V5t3zFqlJ70J0VKSUHIeeq07rkaxcCtQkfTNRwFkEpJABpKbySvWpyZkDop94PVG6/C2Ok4CpbGoe/v9zQ/Azi5iIJwIMm3Yo0p/CEfAGbt61tucEf4sTwptF0TTNYnwxpq4PWB+eZQkYjyCrKCevHe1xdYM5fEL092N88BiajKxQWJ4AN+wtbu1Bt1ZXuny80ao4XLnCDM+aVKaM4loTW2DdzPTUoJgJMcvihk0a2bDIWzTwvQy2CWUHHHtP+Oi/TofHRN6Hg/5CKWVBCVAZhi+R57MWWav3qbuTncqAVNJUWubjybh0cZYAh7CQr/jN0BHQDSSHxgfWsAIaPruuR1BRdQ== Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id en14-20020a056402528e00b0055fe55441cbsm663142edb.40.2024.02.08.02.17.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 02:17:34 -0800 (PST) Date: Thu, 8 Feb 2024 13:17:31 +0300 From: Dan Carpenter To: Matt Chen Cc: Miri Korenblit , Kalle Valo , Johannes Berg , Gregory Greenman , Alon Giladi , Anjaneyulu , Daniel Gabay , Luca Coelho , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 2/2] wifi: iwlwifi: uninitialized variable in iwl_acpi_get_ppag_table() Message-ID: <09900c01-6540-4a32-9451-563da0029cb6@moroto.mountain> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9620bb77-2d7c-4d76-b255-ad824ebf8e35@moroto.mountain> X-Mailer: git-send-email haha only kidding This is an error path and Smatch complains that "tbl_rev" is uninitialized on this path. All the other functions follow this same patter where they set the error code and goto out_free so that's probably what was intended here as well. Fixes: e8e10a37c51c ("iwlwifi: acpi: move ppag code from mvm to fw/acpi") Signed-off-by: Dan Carpenter --- drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c index 506279b95442..6806ac1636ca 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c @@ -848,6 +848,9 @@ int iwl_acpi_get_ppag_table(struct iwl_fw_runtime *fwrt) goto read_table; } + ret = PTR_ERR(wifi_pkg); + goto out_free; + read_table: fwrt->ppag_ver = tbl_rev; flags = &wifi_pkg->package.elements[1];