mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
A pointer was checked for NULL after dereferencing it. The check is not
needed here, except there's a bug which results in detaching the device twice. Move the NULL pointer check to the beginning of the function and convert it into a KASSERT. CID: 420 Found with: Coverity Prevent(tm) Discussed with: ariff MFC after: 5 days
This commit is contained in:
parent
5bba2114d0
commit
cd9de7ee61
1 changed files with 4 additions and 4 deletions
|
|
@ -722,6 +722,8 @@ csa_releaseres(struct csa_info *csa, device_t dev)
|
|||
{
|
||||
csa_res *resp;
|
||||
|
||||
KASSERT(csa != NULL, ("called with bogus resource structure"));
|
||||
|
||||
resp = &csa->res;
|
||||
if (resp->irq != NULL) {
|
||||
if (csa->ih)
|
||||
|
|
@ -741,10 +743,8 @@ csa_releaseres(struct csa_info *csa, device_t dev)
|
|||
bus_dma_tag_destroy(csa->parent_dmat);
|
||||
csa->parent_dmat = NULL;
|
||||
}
|
||||
if (csa != NULL) {
|
||||
free(csa, M_DEVBUF);
|
||||
csa = NULL;
|
||||
}
|
||||
|
||||
free(csa, M_DEVBUF);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
Loading…
Reference in a new issue