Linux USB
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ajay Gupta <ajayg@nvidia.com>, Wolfram Sang <wsa@the-dreams.de>,
	linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [-next] usb: typec: ucsi: ccg: fix missing unlock on error in ccg_cmd_write_flash_row()
Date: Mon, 29 Apr 2019 15:19:40 +0300	[thread overview]
Message-ID: <20190429121940.GA15384@kuha.fi.intel.com> (raw)

On Mon, Apr 29, 2019 at 12:26:30PM +0000, Wei Yongjun wrote:
> Add the missing unlock before return from function ccg_cmd_write_flash_row()
> in the error handling case.
> 
> Fixes: 5c9ae5a87573 ("usb: typec: ucsi: ccg: add firmware flashing support")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/ucsi/ucsi_ccg.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
> index 4632b91a04a6..9d46aa9e4e35 100644
> --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
> @@ -631,6 +631,7 @@ ccg_cmd_write_flash_row(struct ucsi_ccg *uc, u16 row,
>  	ret = i2c_master_send(client, buf, CCG4_ROW_SIZE + 2);
>  	if (ret != CCG4_ROW_SIZE + 2) {
>  		dev_err(uc->dev, "REG_FLASH_RW_MEM write fail %d\n", ret);
> +		mutex_unlock(&uc->lock);
>  		return ret < 0 ? ret : -EIO;
>  	}
> 
> 

thanks,

WARNING: multiple messages have this Message-ID (diff)
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ajay Gupta <ajayg@nvidia.com>, Wolfram Sang <wsa@the-dreams.de>,
	linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH -next] usb: typec: ucsi: ccg: fix missing unlock on error in ccg_cmd_write_flash_row()
Date: Mon, 29 Apr 2019 15:19:40 +0300	[thread overview]
Message-ID: <20190429121940.GA15384@kuha.fi.intel.com> (raw)
Message-ID: <20190429121940.2kUol0oCvrFzEbEJZDd0tkqWJD7lInEk268nbU_JL_Q@z> (raw)
In-Reply-To: <20190429122630.59334-1-weiyongjun1@huawei.com>

On Mon, Apr 29, 2019 at 12:26:30PM +0000, Wei Yongjun wrote:
> Add the missing unlock before return from function ccg_cmd_write_flash_row()
> in the error handling case.
> 
> Fixes: 5c9ae5a87573 ("usb: typec: ucsi: ccg: add firmware flashing support")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/ucsi/ucsi_ccg.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
> index 4632b91a04a6..9d46aa9e4e35 100644
> --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
> @@ -631,6 +631,7 @@ ccg_cmd_write_flash_row(struct ucsi_ccg *uc, u16 row,
>  	ret = i2c_master_send(client, buf, CCG4_ROW_SIZE + 2);
>  	if (ret != CCG4_ROW_SIZE + 2) {
>  		dev_err(uc->dev, "REG_FLASH_RW_MEM write fail %d\n", ret);
> +		mutex_unlock(&uc->lock);
>  		return ret < 0 ? ret : -EIO;
>  	}
> 
> 

thanks,

-- 
heikki

         reply	other threads:[~2019-04-29 12:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29 12:26 [-next] usb: typec: ucsi: ccg: fix missing unlock on error in ccg_cmd_write_flash_row() weiyongjun (A)
2019-04-29 12:19 ` Heikki Krogerus [this message]
2019-04-29 12:19   ` [PATCH -next] " Heikki Krogerus
2019-04-29 12:26 ` Wei Yongjun
2019-04-29 16:52 ` [-next] " Ajay Gupta
2019-04-29 16:52   ` [PATCH -next] " Ajay Gupta

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=20190429121940.GA15384@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=ajayg@nvidia.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=weiyongjun1@huawei.com \
    --cc=wsa@the-dreams.de \
    /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