security: Remove unnecessary checks for mgr == NULL

Coverity found the DACGenLabel was checking for mgr == NULL after a
possible dereference; however, in order to get into the function the
virSecurityManagerGenLabel would have already dereferenced sec_managers[i]
so the check was unnecessary. Same check is made in SELinuxGenSecurityLabel.
This commit is contained in:
John Ferlan 2013-02-13 08:11:39 -05:00
parent 1d816219eb
commit 676688b69b
2 changed files with 0 additions and 12 deletions

View File

@ -913,12 +913,6 @@ virSecurityDACGenLabel(virSecurityManagerPtr mgr,
virSecurityLabelDefPtr seclabel;
virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr);
if (mgr == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("invalid security driver"));
return rc;
}
seclabel = virDomainDefGetSecurityLabelDef(def, SECURITY_DAC_NAME);
if (seclabel == NULL) {
return rc;

View File

@ -560,12 +560,6 @@ virSecuritySELinuxGenSecurityLabel(virSecurityManagerPtr mgr,
virSecuritySELinuxDataPtr data;
const char *baselabel;
if (mgr == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("invalid security driver"));
return rc;
}
seclabel = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME);
if (seclabel == NULL) {
return rc;