<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-linux/drivers/staging/wfx, branch jd/orphan-parallel</title>
<subtitle>WireGuard for the Linux kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-linux/atom/drivers/staging/wfx?h=jd%2Forphan-parallel</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-linux/atom/drivers/staging/wfx?h=jd%2Forphan-parallel'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/'/>
<updated>2020-10-10T10:33:59Z</updated>
<entry>
<title>staging: wfx: improve robustness of wfx_get_hw_rate()</title>
<updated>2020-10-10T10:33:59Z</updated>
<author>
<name>Jérôme Pouiller</name>
<email>jerome.pouiller@silabs.com</email>
</author>
<published>2020-10-09T17:13:07Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=868fd970e187d39c586565c875837e530c6f7e1b'/>
<id>urn:sha1:868fd970e187d39c586565c875837e530c6f7e1b</id>
<content type='text'>
Smatch complains:

    data_tx.c:37 wfx_get_hw_rate() warn: constraint '(struct ieee80211_supported_band)-&gt;bitrates' overflow 'band-&gt;bitrates' 0 &lt;= abs_rl '0-127' user_rl '' required = '(struct ieee80211_supported_band)-&gt;n_bitrates'
    23          struct ieee80211_supported_band *band;
    24
    25          if (rate-&gt;idx &lt; 0)
    26                  return -1;
    27          if (rate-&gt;flags &amp; IEEE80211_TX_RC_MCS) {
    28                  if (rate-&gt;idx &gt; 7) {
    29                          WARN(1, "wrong rate-&gt;idx value: %d", rate-&gt;idx);
    30                          return -1;
    31                  }
    32                  return rate-&gt;idx + 14;
    33          }
    34          // WFx only support 2GHz, else band information should be retrieved
    35          // from ieee80211_tx_info
    36          band = wdev-&gt;hw-&gt;wiphy-&gt;bands[NL80211_BAND_2GHZ];
    37          return band-&gt;bitrates[rate-&gt;idx].hw_value;

Add a simple check to make Smatch happy.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Jérôme Pouiller &lt;jerome.pouiller@silabs.com&gt;
Link: https://lore.kernel.org/r/20201009171307.864608-9-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: wfx: drop unicode characters from strings</title>
<updated>2020-10-10T10:33:59Z</updated>
<author>
<name>Jérôme Pouiller</name>
<email>jerome.pouiller@silabs.com</email>
</author>
<published>2020-10-09T17:13:06Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=c9d47696391d17923ed34451d451fac5ff4939db'/>
<id>urn:sha1:c9d47696391d17923ed34451d451fac5ff4939db</id>
<content type='text'>
Smatch complains:

  hif_rx.c:235 hif_generic_indication() warn: format string contains non-ascii character '\xc2'
  hif_rx.c:235 hif_generic_indication() warn: format string contains non-ascii character '\xb0'
   234                  if (!wfx_api_older_than(wdev, 1, 4))
   235                          dev_info(wdev-&gt;dev, "Rx test ongoing. Temperature: %d°C\n",
                                                                                     ^
   236                                   body-&gt;data.rx_stats.current_temp);

So, replace the unicode character.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Jérôme Pouiller &lt;jerome.pouiller@silabs.com&gt;
Link: https://lore.kernel.org/r/20201009171307.864608-8-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: wfx: gpiod_get_value() can return an error</title>
<updated>2020-10-10T10:33:59Z</updated>
<author>
<name>Jérôme Pouiller</name>
<email>jerome.pouiller@silabs.com</email>
</author>
<published>2020-10-09T17:13:05Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=8522d62e6bca8c8b2fbf456523f01bf36468239c'/>
<id>urn:sha1:8522d62e6bca8c8b2fbf456523f01bf36468239c</id>
<content type='text'>
Smatch complains:

    hif_rx.c:98 hif_wakeup_indication() warn: 'gpiod_get_value(wdev-&gt;pdata.gpio_wakeup)' returns positive and negative
    bh.c:24 device_wakeup() warn: 'gpiod_get_value_cansleep(wdev-&gt;pdata.gpio_wakeup)' returns positive and negative

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Jérôme Pouiller &lt;jerome.pouiller@silabs.com&gt;
Link: https://lore.kernel.org/r/20201009171307.864608-7-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: wfx: increase robustness of hif_generic_confirm()</title>
<updated>2020-10-10T10:33:59Z</updated>
<author>
<name>Jérôme Pouiller</name>
<email>jerome.pouiller@silabs.com</email>
</author>
<published>2020-10-09T17:13:04Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=5f841fe69832c8440a5d940e4d768cf7b96f3b9f'/>
<id>urn:sha1:5f841fe69832c8440a5d940e4d768cf7b96f3b9f</id>
<content type='text'>
Smatch complains:

    drivers/staging/wfx/hif_rx.c:26 hif_generic_confirm() warn: negative user subtract: 0-u16max - 4
    20  static int hif_generic_confirm(struct wfx_dev *wdev,
    21                                 const struct hif_msg *hif, const void *buf)
    22  {
    23          // All confirm messages start with status
    24          int status = le32_to_cpup((__le32 *)buf);
    25          int cmd = hif-&gt;id;
    26          int len = le16_to_cpu(hif-&gt;len) - 4; // drop header
                                              ^^^^^
    27
    28          WARN(!mutex_is_locked(&amp;wdev-&gt;hif_cmd.lock), "data locking error");

In fact, rx_helper() already make the necessary checks on the value of
hif-&gt;len. Never mind, add an explicit check to make Smatch happy.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Jérôme Pouiller &lt;jerome.pouiller@silabs.com&gt;
Link: https://lore.kernel.org/r/20201009171307.864608-6-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: wfx: wfx_init_common() returns NULL on error</title>
<updated>2020-10-10T10:33:59Z</updated>
<author>
<name>Jérôme Pouiller</name>
<email>jerome.pouiller@silabs.com</email>
</author>
<published>2020-10-09T17:13:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=b3c669be90ddfa70409ab6335dadf3ef46473f9a'/>
<id>urn:sha1:b3c669be90ddfa70409ab6335dadf3ef46473f9a</id>
<content type='text'>
Smatch complains:

    bus_spi.c:228 wfx_spi_probe() warn: 'bus-&gt;core' could be an error pointer
    bus_sdio.c:221 wfx_sdio_probe() warn: 'bus-&gt;core' could be an error pointer

bus-&gt;core contains the result of wfx_init_common(). With this patch,
wfx_init_common() returns a valid pointer or NULL.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Jérôme Pouiller &lt;jerome.pouiller@silabs.com&gt;
Link: https://lore.kernel.org/r/20201009171307.864608-5-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: wfx: standardize the error when vif does not exist</title>
<updated>2020-10-10T10:33:59Z</updated>
<author>
<name>Jérôme Pouiller</name>
<email>jerome.pouiller@silabs.com</email>
</author>
<published>2020-10-09T17:13:02Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=bb97bc286171f58f3286c2d1da876c7a62708ea6'/>
<id>urn:sha1:bb97bc286171f58f3286c2d1da876c7a62708ea6</id>
<content type='text'>
Smatch complains:

   drivers/staging/wfx/hif_rx.c:177 hif_scan_complete_indication() warn: potential NULL parameter dereference 'wvif'
   drivers/staging/wfx/data_tx.c:576 wfx_flush() warn: potential NULL parameter dereference 'wvif'

Indeed, if the vif id returned by the device does not exist anymore,
wdev_to_wvif() could return NULL.

In add, the error is not handled uniformly in the code, sometime a
WARN() is displayed but code continue, sometime a dev_warn() is
displayed, sometime it is just not tested, ...

This patch standardize that.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Jérôme Pouiller &lt;jerome.pouiller@silabs.com&gt;
Link: https://lore.kernel.org/r/20201009171307.864608-4-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: wfx: check memory allocation</title>
<updated>2020-10-10T10:33:59Z</updated>
<author>
<name>Jérôme Pouiller</name>
<email>jerome.pouiller@silabs.com</email>
</author>
<published>2020-10-09T17:13:01Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=fd2575c4a45017068445bfe31e93522e2d451d76'/>
<id>urn:sha1:fd2575c4a45017068445bfe31e93522e2d451d76</id>
<content type='text'>
Smatch complains:

   main.c:228 wfx_send_pdata_pds() warn: potential NULL parameter dereference 'tmp_buf'
   227          tmp_buf = kmemdup(pds-&gt;data, pds-&gt;size, GFP_KERNEL);
   228          ret = wfx_send_pds(wdev, tmp_buf, pds-&gt;size);
                                         ^^^^^^^
   229          kfree(tmp_buf);

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Jérôme Pouiller &lt;jerome.pouiller@silabs.com&gt;
Link: https://lore.kernel.org/r/20201009171307.864608-3-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: wfx: improve error handling of hif_join()</title>
<updated>2020-10-10T10:33:58Z</updated>
<author>
<name>Jérôme Pouiller</name>
<email>jerome.pouiller@silabs.com</email>
</author>
<published>2020-10-09T17:13:00Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=1cd8909642183804904e3ad6292dcee92fc7d005'/>
<id>urn:sha1:1cd8909642183804904e3ad6292dcee92fc7d005</id>
<content type='text'>
Smatch complains:

   hif_tx.c:319 hif_join() error: we previously assumed 'channel' could be null (see line 315)
   311          if (!hif)
   312                  return -ENOMEM;
   313          body-&gt;infrastructure_bss_mode = !conf-&gt;ibss_joined;
   314          body-&gt;short_preamble = conf-&gt;use_short_preamble;
   315          if (channel &amp;&amp; channel-&gt;flags &amp; IEEE80211_CHAN_NO_IR)
                    ^^^^^^^
   316                  body-&gt;probe_for_join = 0;
   317          else
   318                  body-&gt;probe_for_join = 1;
   319          body-&gt;channel_number = channel-&gt;hw_value;
                                       ^^^^^^^^^^^^^^^^^
   320          body-&gt;beacon_interval = cpu_to_le32(conf-&gt;beacon_int);
   321          body-&gt;basic_rate_set =

Indeed, channel can't be NULL (else I would have seen plenty of Ooops
this past year). This patch explicitly claims this restriction.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Jérôme Pouiller &lt;jerome.pouiller@silabs.com&gt;
Link: https://lore.kernel.org/r/20201009171307.864608-2-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>dt-bindings: staging: wfx: silabs,wfx yaml conversion</title>
<updated>2020-10-07T10:55:47Z</updated>
<author>
<name>Jérôme Pouiller</name>
<email>jerome.pouiller@silabs.com</email>
</author>
<published>2020-10-07T10:19:42Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=76c3bdd67d27289b9e407113821eab2a70bbcca6'/>
<id>urn:sha1:76c3bdd67d27289b9e407113821eab2a70bbcca6</id>
<content type='text'>
The device can be connected on SPI or on SDIO. The original file
described the two options separately. So, most of the file had to be
rewritten in order to match with the Yaml requirements.

Some device requirements are still written in the comments since they
cannot been expressed with the current scheme (e.g. reg must be set to 1
with SDIO, interrupt is mandatory with SPI, reset-gpio in SPI is
replaced by mmc-pwrseq in SDIO, etc...).

The examples provided have also been reworked in order to make
dt_binding_check happy.

Finally, also fix typo in the name of the file (siliabs instead of
silabs)

Signed-off-by: Jérôme Pouiller &lt;jerome.pouiller@silabs.com&gt;
Link: https://lore.kernel.org/r/20201007101943.749898-7-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: wfx: update copyrights dates</title>
<updated>2020-10-07T10:55:47Z</updated>
<author>
<name>Jérôme Pouiller</name>
<email>jerome.pouiller@silabs.com</email>
</author>
<published>2020-10-07T10:19:41Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=f9dc9f3750e1e2bd0358122542c7cc08679a7236'/>
<id>urn:sha1:f9dc9f3750e1e2bd0358122542c7cc08679a7236</id>
<content type='text'>
Most of the files have been modified in 2020, so update the copyright
notices.

Signed-off-by: Jérôme Pouiller &lt;jerome.pouiller@silabs.com&gt;
Link: https://lore.kernel.org/r/20201007101943.749898-6-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
