All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: aik@ozlabs.ru
Cc: kvm@vger.kernel.org
Subject: [bug report] vfio/spapr: Postpone default window creation
Date: Tue, 17 Jan 2017 16:55:28 +0300	[thread overview]
Message-ID: <20170117135528.GA6353@mwanda> (raw)

Hello Alexey Kardashevskiy,

The patch d9c728949ddc: "vfio/spapr: Postpone default window
creation" from Nov 30, 2016, leads to the following static checker
warning:

	drivers/vfio/vfio_iommu_spapr_tce.c:1180 tce_iommu_ioctl()
	warn: inconsistent returns 'mutex:&container->lock'.

drivers/vfio/vfio_iommu_spapr_tce.c
  1114                  if (copy_from_user(&create, (void __user *)arg, minsz))
  1115                          return -EFAULT;
  1116  
  1117                  if (create.argsz < minsz)
  1118                          return -EINVAL;
  1119  
  1120                  if (create.flags)
  1121                          return -EINVAL;
  1122  
  1123                  mutex_lock(&container->lock);
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1124  
  1125                  ret = tce_iommu_create_default_window(container);
  1126                  if (ret)
  1127                          return ret;


We can't return directly while holding the lock.

  1128  
  1129                  ret = tce_iommu_create_window(container, create.page_shift,
  1130                                  create.window_size, create.levels,
  1131                                  &create.start_addr);
  1132  
  1133                  mutex_unlock(&container->lock);
  1134  
  1135                  if (!ret && copy_to_user((void __user *)arg, &create, minsz))
  1136                          ret = -EFAULT;
  1137  
  1138                  return ret;
  1139          }


regards,
dan carpenter

                 reply	other threads:[~2017-01-17 13:57 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=20170117135528.GA6353@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=aik@ozlabs.ru \
    --cc=kvm@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.