summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2022-02-05 13:37:37 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-02-05 13:38:05 +0100
commit19706231bc5f2445f0881c2d23a464bf92e51855 (patch)
tree2cab43ba1c904752a3d0886873f2cdea55d86611
parentf94e6284aa777ab7b63374759b35e0d8219e3d4d (diff)
rumpdisk: add missing device_close on probing kernel driversv0.9.git20220206
If any device_open succeeds, we should clean its effect.
-rw-r--r--rumpdisk/block-rump.c2
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;