LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	Ian Munsie <imunsie@au1.ibm.com>,
	Christophe Lombard <clombard@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] cxl: Unlock on error in probe
Date: Fri, 5 May 2017 17:29:46 +0200	[thread overview]
Message-ID: <88932312-cbb5-40b0-da84-430535314389@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170505053458.csrwd2kjber44r4o@mwanda>



Le 05/05/2017 à 07:34, Dan Carpenter a écrit :
> We should unlock if get_cxl_adapter() fails.
>
> Fixes: 594ff7d067ca ("cxl: Support to flash a new image on the adapter from a guest")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>

Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>

Thanks!

   Fred



> diff --git a/drivers/misc/cxl/flash.c b/drivers/misc/cxl/flash.c
> index 7c61c70ba3f6..37475abea3e6 100644
> --- a/drivers/misc/cxl/flash.c
> +++ b/drivers/misc/cxl/flash.c
> @@ -401,8 +401,10 @@ static int device_open(struct inode *inode, struct file *file)
>  	if (down_interruptible(&sem) != 0)
>  		return -EPERM;
>
> -	if (!(adapter = get_cxl_adapter(adapter_num)))
> -		return -ENODEV;
> +	if (!(adapter = get_cxl_adapter(adapter_num))) {
> +		rc = -ENODEV;
> +		goto err_unlock;
> +	}
>
>  	file->private_data = adapter;
>  	continue_token = 0;
> @@ -446,6 +448,8 @@ static int device_open(struct inode *inode, struct file *file)
>  		free_page((unsigned long) le);
>  err:
>  	put_device(&adapter->dev);
> +err_unlock:
> +	up(&sem);
>
>  	return rc;
>  }
>

  reply	other threads:[~2017-05-05 15:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05  5:34 [PATCH] cxl: Unlock on error in probe Dan Carpenter
2017-05-05 15:29 ` Frederic Barrat [this message]
2017-06-08  4:07 ` Michael Ellerman
     [not found] <20170505053622.0670F124037@b01ledav002.gho.pok.ibm.com>
2017-05-05  7:14 ` [PATCH] " Andrew Donnellan
2017-05-05  7:23   ` walter harms
2017-05-05  7:39     ` Dan Carpenter
2017-05-05  7:37   ` Dan Carpenter
     [not found]   ` <20170505073800.4F753124037@b01ledav002.gho.pok.ibm.com>
2017-05-05  7:46     ` Andrew Donnellan

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=88932312-cbb5-40b0-da84-430535314389@linux.vnet.ibm.com \
    --to=fbarrat@linux.vnet.ibm.com \
    --cc=clombard@linux.vnet.ibm.com \
    --cc=dan.carpenter@oracle.com \
    --cc=imunsie@au1.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.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