mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 01:43:23 +00:00
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:
parent
1d816219eb
commit
676688b69b
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user