mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-12 09:58:36 +00:00
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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=107386
@ -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