diff options
author | sam <sam@FreeBSD.org> | 2005-03-26 18:17:58 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2005-03-26 18:17:58 +0000 |
commit | 99145b743f7a7f3163fcfc38331da87d9df347b6 (patch) | |
tree | 8812baaaea7889f81717b59fd552441782a210bf /sys/dev/sym/sym_hipd.c | |
parent | d1426a3f0d8d59a29f5236ad92d60cdd60a9938d (diff) | |
download | FreeBSD-src-99145b743f7a7f3163fcfc38331da87d9df347b6.zip FreeBSD-src-99145b743f7a7f3163fcfc38331da87d9df347b6.tar.gz |
eliminate double free when sym_cam_attach fails
Noticed by: Coverity Prevent analysis tool
Diffstat (limited to 'sys/dev/sym/sym_hipd.c')
-rw-r--r-- | sys/dev/sym/sym_hipd.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/sym/sym_hipd.c b/sys/dev/sym/sym_hipd.c index 7e05c22..54abca6 100644 --- a/sys/dev/sym/sym_hipd.c +++ b/sys/dev/sym/sym_hipd.c @@ -9203,15 +9203,20 @@ fail: */ static void sym_cam_free(hcb_p np) { - if (np->intr) + if (np->intr) { bus_teardown_intr(np->device, np->irq_res, np->intr); + np->intr = NULL; + } if (np->sim) { xpt_bus_deregister(cam_sim_path(np->sim)); cam_sim_free(np->sim, /*free_devq*/ TRUE); + np->sim = NULL; } - if (np->path) + if (np->path) { xpt_free_path(np->path); + np->path = NULL; + } } /*============ OPTIONNAL NVRAM SUPPORT =================*/ |