Release the reference to the peripheral if returning a error.
That reference is to be held only if daopen() has been successful and until daclose() releases it. daclose() won't be called if daopen() has failed, though. Approved by: re, njl MFC after: 1 week
This commit is contained in:
parent
ef31810d3f
commit
b7c8a7976f
@ -611,6 +611,8 @@ daopen(dev_t dev, int flags __unused, int fmt __unused, struct thread *td __unus
|
||||
if (error == 0) {
|
||||
if ((softc->flags & DA_FLAG_PACK_REMOVABLE) != 0)
|
||||
daprevent(periph, PR_PREVENT);
|
||||
} else {
|
||||
cam_periph_release(periph);
|
||||
}
|
||||
cam_periph_unlock(periph);
|
||||
return (error);
|
||||
|
Loading…
Reference in New Issue
Block a user