提交 a8513ae6 编写于 作者: O openharmony_ci 提交者: Gitee

!613 解决sd卡读写操作时对卡进行热插拔后,disk资源未释放问题

Merge pull request !613 from 董逸群/OpenHarmony_1.0.1_release
...@@ -1279,20 +1279,20 @@ static INT32 DiskDeinit(los_disk *disk) ...@@ -1279,20 +1279,20 @@ static INT32 DiskDeinit(los_disk *disk)
#endif #endif
disk->dev = NULL; disk->dev = NULL;
DISK_UNLOCK(&disk->disk_mutex);
(VOID)unregister_blockdriver(disk->disk_name); (VOID)unregister_blockdriver(disk->disk_name);
if (disk->disk_name != NULL) { if (disk->disk_name != NULL) {
LOS_MemFree(m_aucSysMem0, disk->disk_name); LOS_MemFree(m_aucSysMem0, disk->disk_name);
disk->disk_name = NULL; disk->disk_name = NULL;
} }
DISK_UNLOCK(&disk->disk_mutex);
disk->disk_status = STAT_UNUSED;
ret = pthread_mutex_destroy(&disk->disk_mutex); ret = pthread_mutex_destroy(&disk->disk_mutex);
if (ret != 0) { if (ret != 0) {
PRINT_ERR("%s %d, mutex destroy failed, ret = %d\n", __FUNCTION__, __LINE__, ret); PRINT_ERR("%s %d, mutex destroy failed, ret = %d\n", __FUNCTION__, __LINE__, ret);
return -EFAULT; return -EFAULT;
} }
disk->disk_status = STAT_UNUSED;
return ENOERR; return ENOERR;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册