- improve error checking
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Thu, 4 Jan 2007 16:22:06 +0000 (16:22 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Thu, 4 Jan 2007 16:22:06 +0000 (16:22 +0000)
svn path=/trunk/; revision=25295

reactos/drivers/multimedia/audio/sndblst/sndblst.c

index d31a8b0..982ed1a 100644 (file)
@@ -68,9 +68,15 @@ static NTSTATUS InitDevice(
     DPRINT("Creating DOS link\n");
 
     /* Create the dos device link */
-    IoCreateSymbolicLink(&SymlinkName,
+    s = IoCreateSymbolicLink(&SymlinkName,
                       &DeviceName);
 
+       if (!NT_SUCCESS(s))
+    {
+        IoDeleteDevice(DeviceObject);
+        return s;
+    }
+
     DPRINT("Initializing device\n");
 
 //    DPRINT("Allocating memory for parameters structure\n");
@@ -126,6 +132,7 @@ static NTSTATUS InitDevice(
         // Set state indication somehow
         // Failure - what error code do we give?!
         // return STATUS_????
+        IoDeleteDevice(DeviceObject);
         return STATUS_UNSUCCESSFUL;
     }