kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: der.herr@hofr.at (Nicholas Mc Guire)
To: kernelnewbies@lists.kernelnewbies.org
Subject: How to mark suspicious code?
Date: Fri, 6 Nov 2015 05:39:13 +0000	[thread overview]
Message-ID: <20151106053913.GA8192@osadl.at> (raw)
In-Reply-To: <20151106050258.GA1599@kroah.com>

On Thu, Nov 05, 2015 at 09:02:58PM -0800, Greg KH wrote:
> On Fri, Nov 06, 2015 at 10:28:31AM +0700, Ivan Safonov wrote:
> > On 11/06/2015 08:58 AM, Greg KH wrote:
> > >On Fri, Nov 06, 2015 at 08:45:46AM +0700, Ivan Safonov wrote:
> > >>Hi all!
> > >>
> > >>How can I mark suspicious code, if I can not fix it?
> > >What do you mean by "mark"?
> > Leave a comment in the code, write a letter to maintainer, etc.
> > What to do?
> > >And also what do you mean by "suspicious"?
> > This is the wrong code that needs to be corrected.
> > >And why can't you fix it?
> > >
> > >we need more details.
> > >
> > >thanks,
> > >
> > >greg k-h
> > Correction of the code will change the behavior of the program.
> > For example:
> > 
> >     while (1) {
> >         if (down_interruptible(&pcmdpriv->cmd_queue_sema))
> >             break;
> > 
> >         if (padapter->bDriverStopped || padapter->bSurpriseRemoved) {
> >             ...
> >             break;
> >         }
> > _next:
> >         if (padapter->bDriverStopped || padapter->bSurpriseRemoved) {
> >             ...
> >             break;
> >         }
> >         ...
> >         if (!pcmd)
> >             continue;
> >         ...
> >         goto _next;
> >     }
> >     ...
> >     up(&pcmdpriv->terminate_cmdthread_sema);
> > 
> > Here down_interruptible(sem) in the loop but up(sem) only after the loop.
> > Corrected example below:

don't get it - what does 
  down_interruptible(&pcmdpriv->cmd_queue_sema)
have to do with:
  up(&pcmdpriv->terminate_cmdthread_sema)
its a different sem.

thx!
hofrat

  reply	other threads:[~2015-11-06  5:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <563B58FD.3080406@gmail.com>
2015-11-06  1:45 ` How to mark suspicious code? Ivan Safonov
2015-11-06  1:58   ` Greg KH
2015-11-06  3:28     ` Ivan Safonov
2015-11-06  5:02       ` Greg KH
2015-11-06  5:39         ` Nicholas Mc Guire [this message]
2015-11-06 14:38         ` Ivan Safonov

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=20151106053913.GA8192@osadl.at \
    --to=der.herr@hofr.at \
    --cc=kernelnewbies@lists.kernelnewbies.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).