linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luciano Coelho <luciano.coelho@intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>, haim.dreyfuss@intel.com
Cc: linux-wireless@vger.kernel.org
Subject: Re: [bug report] iwlwifi: Add support for SAR South Korea limitation
Date: Fri, 23 Aug 2019 11:47:38 +0300	[thread overview]
Message-ID: <1cfaffb7bcd3bf1e8ff9f18fda0cfbee4b716176.camel@intel.com> (raw)
In-Reply-To: <20190806142435.GA13072@mwanda>

Hi Dan,

On Tue, 2019-08-06 at 17:24 +0300, Dan Carpenter wrote:
> Hello Haim Dreyfuss,
> 
> The patch 0c3d7282233c: "iwlwifi: Add support for SAR South Korea
> limitation" from Feb 27, 2019, leads to the following static checker
> warning:
> 
> 	drivers/net/wireless/intel/iwlwifi/fw/acpi.c:166 iwl_acpi_get_mcc()
> 	warn: passing a valid pointer to 'PTR_ERR'
> 
> drivers/net/wireless/intel/iwlwifi/fw/acpi.c
>    153  int iwl_acpi_get_mcc(struct device *dev, char *mcc)
>    154  {
>    155          union acpi_object *wifi_pkg, *data;
>    156          u32 mcc_val;
>    157          int ret, tbl_rev;
>    158  
>    159          data = iwl_acpi_get_object(dev, ACPI_WRDD_METHOD);
>    160          if (IS_ERR(data))
>    161                  return PTR_ERR(data);
>    162  
>    163          wifi_pkg = iwl_acpi_get_wifi_pkg(dev, data, ACPI_WRDD_WIFI_DATA_SIZE,
>    164                                           &tbl_rev);
>    165          if (IS_ERR(wifi_pkg) || tbl_rev != 0) {
>                                         ^^^^^^^^^^^^
> wifi_pkg is not a valid error code.  Also it feels like it might be more
> future proof to blacklist rev 1 instead of whitelisting rev 0.

Yeah, this code is wrong.  If wifi_pkg is valid but tbl_rev is != 0,
then we will return a valid pointer instead of an error.  I'll fix
this.

But regarding blacklisting one, I think it's better as it is.  We mean
that the only revision we support is 0, if we get 1 or higher, we
return -EINVAL, because we handle it.  When we add support for other
revisions, we need to change it.


>    166                  ret = PTR_ERR(wifi_pkg);
>    167                  goto out_free;
>    168          }


Thanks for reporting!

(and yeah, I'll handle the other occurrences you mentioned too).

--
Cheers,
Luca.



      parent reply	other threads:[~2019-08-23  8:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-06 14:24 [bug report] iwlwifi: Add support for SAR South Korea limitation Dan Carpenter
2019-08-06 14:30 ` Dan Carpenter
2019-08-23  8:47 ` Luciano Coelho [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1cfaffb7bcd3bf1e8ff9f18fda0cfbee4b716176.camel@intel.com \
    --to=luciano.coelho@intel.com \
    --cc=dan.carpenter@oracle.com \
    --cc=haim.dreyfuss@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).