All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: RaghavaAditya.Renukunta@microsemi.com
Cc: linux-scsi@vger.kernel.org
Subject: [bug report] scsi: aacraid: Include HBA direct interface
Date: Mon, 13 Feb 2017 21:41:02 +0300	[thread overview]
Message-ID: <20170213184101.GA4762@mwanda> (raw)

Hello Raghava Aditya Renukunta,

The patch 423400e64d37: "scsi: aacraid: Include HBA direct interface"
from Feb 2, 2017, leads to the following static checker warning:

	drivers/scsi/aacraid/commsup.c:762 aac_hba_send()
	error: double unlock 'sem:&fibptr->event_wait'

drivers/scsi/aacraid/commsup.c
   757          if (wait) {
   758                  spin_unlock_irqrestore(&fibptr->event_lock, flags);
   759                  /* Only set for first known interruptable command */

This comment just confuses me...  What is a "known interruptable command?"

   760                  if (down_interruptible(&fibptr->event_wait)) {

down_interruptible() return -EINTR on failure so this test looks
reversed.  It should probably be:

			if (!down_interruptible(&fibptr->event_wait)) {


   761                          fibptr->done = 2;
   762                          up(&fibptr->event_wait);
   763                  }
   764                  spin_lock_irqsave(&fibptr->event_lock, flags);
   765                  if ((fibptr->done == 0) || (fibptr->done == 2)) {
   766                          fibptr->done = 2; /* Tell interrupt we aborted */
   767                          spin_unlock_irqrestore(&fibptr->event_lock, flags);
   768                          return -ERESTARTSYS;
   769                  }
   770                  spin_unlock_irqrestore(&fibptr->event_lock, flags);
   771                  WARN_ON(fibptr->done == 0);
   772  
   773                  if (unlikely(fibptr->flags & FIB_CONTEXT_FLAG_TIMED_OUT))
   774                          return -ETIMEDOUT;
   775  
   776                  return 0;
   777          }

regards,
dan carpenter

                 reply	other threads:[~2017-02-13 18:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20170213184101.GA4762@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=RaghavaAditya.Renukunta@microsemi.com \
    --cc=linux-scsi@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.