diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-02-05 13:37:37 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-02-05 13:38:05 +0100 |
commit | 19706231bc5f2445f0881c2d23a464bf92e51855 (patch) | |
tree | 2cab43ba1c904752a3d0886873f2cdea55d86611 /rumpdisk | |
parent | f94e6284aa777ab7b63374759b35e0d8219e3d4d (diff) | |
download | hurd-19706231bc5f2445f0881c2d23a464bf92e51855.tar.gz hurd-19706231bc5f2445f0881c2d23a464bf92e51855.tar.bz2 hurd-19706231bc5f2445f0881c2d23a464bf92e51855.zip |
rumpdisk: add missing device_close on probing kernel drivers
If any device_open succeeds, we should clean its effect.
Diffstat (limited to 'rumpdisk')
-rw-r--r-- | rumpdisk/block-rump.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/rumpdisk/block-rump.c b/rumpdisk/block-rump.c index c14ca7af..6539850e 100644 --- a/rumpdisk/block-rump.c +++ b/rumpdisk/block-rump.c @@ -161,6 +161,8 @@ rumpdisk_device_init (void) || ! device_open (device_master, D_READ, "sd2", &device) || ! device_open (device_master, D_READ, "sd3", &device)) { + device_close (device); + mach_port_deallocate (mach_task_self (), device); fprintf(stderr, "Kernel is already driving a SATA device, skipping probing disks\n"); fflush(stderr); disabled = 1; |