Hi, > -----Original Message----- > From: Huang, Wei <wei.hu...@intel.com> > Sent: Thursday, November 05, 2020 10:06 > To: dev@dpdk.org; Xu, Rosen <rosen...@intel.com>; Zhang, Qi Z > <qi.z.zh...@intel.com> > Cc: sta...@dpdk.org; Huang, Wei <wei.hu...@intel.com> > Subject: [PATCH v2 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.hu...@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; > } > > -- > 2.29.2
Acked-by: Rosen Xu <rosen...@intel.com>