From: "Zhang, Tianfei" <tianfei.zhang@intel.com>
To: "Huang, Wei" <wei.huang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>,
"Xu, Rosen" <rosen.xu@intel.com>,
"Zhang, Qi Z" <qi.z.zhang@intel.com>
Cc: "stable@dpdk.org" <stable@dpdk.org>, "Huang, Wei" <wei.huang@intel.com>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v1 1/2] raw/ifpga/base: unlock mutex when nios init fail
Date: Thu, 5 Nov 2020 09:33:24 +0000 [thread overview]
Message-ID: <DM6PR11MB3131DB09DABA384BF3F0349BE3EE0@DM6PR11MB3131.namprd11.prod.outlook.com> (raw)
In-Reply-To: <1604540969-5503-2-git-send-email-wei.huang@intel.com>
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Wei Huang
> Sent: 2020年11月5日 9:49
> To: dev@dpdk.org; Xu, Rosen <rosen.xu@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Cc: stable@dpdk.org; Huang, Wei <wei.huang@intel.com>
> Subject: [dpdk-dev] [PATCH v1 1/2] raw/ifpga/base: unlock mutex when nios
> init fail
>
> In fme_nios_spi_init(), a mutex is locked for protecting nios initialization
> process, the mutex is only unlocked when process is successful, it should also
> be unlocked when process fail.
>
> Fixes: e41856b515ce ("raw/ifpga/base: enhance driver reliability in
> multi-process") Coverity issue: 363751
>
> Signed-off-by: Wei Huang <wei.huang@intel.com>
> ---
> drivers/raw/ifpga/base/ifpga_fme.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/raw/ifpga/base/ifpga_fme.c
> b/drivers/raw/ifpga/base/ifpga_fme.c
> index 540bb1110..f29ff3159 100644
> --- a/drivers/raw/ifpga/base/ifpga_fme.c
> +++ b/drivers/raw/ifpga/base/ifpga_fme.c
> @@ -1115,6 +1115,8 @@ static int fme_nios_spi_init(struct ifpga_feature
> *feature)
> ret = nios_spi_wait_init_done(spi_master);
> if (ret != 0) {
> dev_err(fme, "FME NIOS_SPI init fail\n");
> + if (spi_master->mutex)
> + pthread_mutex_unlock(spi_master->mutex);
> goto release_dev;
> }
>
Acked-by: Tianfei zhang <tianfei.zhang@intel.com>
> --
> 2.29.2
next prev parent reply other threads:[~2020-11-05 9:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-05 1:49 [dpdk-stable] [PATCH v1 0/2] Fix defects found by coverity scan Wei Huang
2020-11-05 1:49 ` [dpdk-stable] [PATCH v1 1/2] raw/ifpga/base: unlock mutex when nios init fail Wei Huang
2020-11-05 9:33 ` Zhang, Tianfei [this message]
2020-11-05 1:49 ` [dpdk-stable] [PATCH v1 2/2] raw/ifpga/base: check pointer adapter before derefence Wei Huang
2020-11-05 9:35 ` [dpdk-stable] [dpdk-dev] " Zhang, Tianfei
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=DM6PR11MB3131DB09DABA384BF3F0349BE3EE0@DM6PR11MB3131.namprd11.prod.outlook.com \
--to=tianfei.zhang@intel.com \
--cc=dev@dpdk.org \
--cc=qi.z.zhang@intel.com \
--cc=rosen.xu@intel.com \
--cc=stable@dpdk.org \
--cc=wei.huang@intel.com \
/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).