All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Bastien Nocera <hadess@hadess.net>,
	Jes Sorensen <jes.sorensen@gmail.com>,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH] staging: Add rtl8723bs sdio wifi driver
Date: Tue, 4 Apr 2017 20:53:41 +0200	[thread overview]
Message-ID: <d5fc988b-2962-9c44-7eac-96dba606f56a@redhat.com> (raw)
In-Reply-To: <4d1d3c02-eff6-0410-cee0-9360ec645e13@lwfinger.net>

Hi,

On 04/04/2017 08:31 PM, Larry Finger wrote:
> On 03/29/2017 12:47 PM, Hans de Goede wrote:
>> The rtl8723bs is found on quite a few systems used by Linux users,
>> such as on Atom systems (Intel Computestick and various other
>> Atom based devices) and on many (budget) ARM boards such as
>> the CHIP.
>>
>> The plan moving forward with this is for the new clean,
>> written from scratch, rtl8xxxu driver to eventually gain
>> support for sdio devices. But there is no clear timeline
>> for that, so lets add this driver included in staging for now.
>
> Hans,
>
> I started looking at the Smatch errors. This one may be the result of a serious problem:
>
>   CHECK   drivers/staging/rtl8723bs/core/rtw_debug.c
> drivers/staging/rtl8723bs/core/rtw_debug.c:454 proc_get_survey_info() error: we previously assumed 'phead' could be null (see line 453)
> drivers/staging/rtl8723bs/core/rtw_debug.c:455 proc_get_survey_info() warn: variable dereferenced before check 'phead' (see line 454)
>
> A snippet of the code in question is as follows:
>
>         spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
>         phead = get_list_head(queue);
>         plist = phead ? get_next(phead) : NULL;
>         plist = get_next(phead);
>         if ((!phead) || (!plist)) {
>                 spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
>                 return 0;
>         }
>
> This code comes directly from the hadess repo, but I am suspicious of the double call to get_next(phead). I cannot imagine any valid reason to skip every other entry on that list.

If you look closer and simplify the first getnext line what is written is:

          plist = get_next(phead);
          plist = get_next(phead);

Which indeed looks like it could use improvement, but I don't
think it is seriously broken.

Regards,

Hans

  reply	other threads:[~2017-04-04 18:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170329174751.13184-1-hdegoede@redhat.com>
2017-03-29 17:54 ` [PATCH] staging: Add rtl8723bs sdio wifi driver Hans de Goede
2017-03-30  1:20 ` Larry Finger
2017-03-30  7:15   ` Greg Kroah-Hartman
2017-03-30 14:06     ` Jes Sorensen
2017-03-30 15:22       ` poma
2017-04-04 18:31 ` Larry Finger
2017-04-04 18:53   ` Hans de Goede [this message]
2017-04-04 19:47     ` Larry Finger
2017-04-04 21:38     ` Arend Van Spriel
2017-04-04 21:53       ` Hans de Goede
2017-04-04 23:41         ` Larry Finger
2017-04-05  9:36           ` Hans de Goede
2017-04-05 16:32             ` Larry Finger
2017-04-06  6:55               ` Hans de Goede
2017-04-06  9:04                 ` Bastien Nocera
2017-04-06  9:49                   ` Hans de Goede
2017-04-06 18:32                     ` Larry Finger
2017-04-06 18:36                       ` Jes Sorensen

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=d5fc988b-2962-9c44-7eac-96dba606f56a@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=hadess@hadess.net \
    --cc=jes.sorensen@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.