1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

coverity: return value check in lvmlockd-dlm

daemons/lvmlockd/lvmlockd-dlm.c:647: check_return: Calling "closedir" without checking return value (as is done elsewhere 13 out of 14 times).
This commit is contained in:
Peter Rajnoha 2015-08-04 09:49:23 +02:00
parent 83541123c8
commit c78033233a

View File

@ -616,6 +616,7 @@ int lm_unlock_dlm(struct lockspace *ls, struct resource *r,
int lm_get_lockspaces_dlm(struct list_head *ls_rejoin) int lm_get_lockspaces_dlm(struct list_head *ls_rejoin)
{ {
static const char closedir_err_msg[] = "lm_get_lockspace_dlm: closedir failed";
struct lockspace *ls; struct lockspace *ls;
struct dirent *de; struct dirent *de;
DIR *ls_dir; DIR *ls_dir;
@ -632,7 +633,7 @@ int lm_get_lockspaces_dlm(struct list_head *ls_rejoin)
if (!(ls = alloc_lockspace())) { if (!(ls = alloc_lockspace())) {
if (closedir(ls_dir)) if (closedir(ls_dir))
log_error("lm_get_lockspace_dlm: closedir failed"); log_error(closedir_err_msg);
return -ENOMEM; return -ENOMEM;
} }
@ -642,7 +643,8 @@ int lm_get_lockspaces_dlm(struct list_head *ls_rejoin)
list_add_tail(&ls->list, ls_rejoin); list_add_tail(&ls->list, ls_rejoin);
} }
closedir(ls_dir); if (closedir(ls_dir))
log_error(closedir_err_msg);
return 0; return 0;
} }