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.
Coverity issue: 363751
Fixes:
e41856b515ce ("raw/ifpga/base: enhance driver reliability in multi-process")
Signed-off-by: Wei Huang <wei.huang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
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;
}