From 351349b4c46ddff1ab9366ee43f7279a34c6a42d Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 2 Nov 2020 17:18:39 +0100 Subject: api: return correct error when there's a duplicate Signed-off-by: Jason A. Donenfeld --- api/adapter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'api') diff --git a/api/adapter.c b/api/adapter.c index 9d2a0b4..973316e 100644 --- a/api/adapter.c +++ b/api/adapter.c @@ -1597,10 +1597,10 @@ CreateAdapter( PropertyType == DEVPROP_TYPE_NTSTATUS) { Result = RtlNtStatusToDosError(ProblemStatus); + _Analysis_assume_(Result != ERROR_SUCCESS); if (ProblemStatus != STATUS_PNP_DEVICE_CONFIGURATION_PENDING || Tries == 999) { LOG_ERROR(L"Failed to setup adapter", Result); - Result = ERROR_GEN_FAILURE; goto cleanupTcpipInterfaceRegKey; } Sleep(10); @@ -1608,6 +1608,7 @@ CreateAdapter( else break; } + Result = ERROR_SUCCESS; *Adapter = a; -- cgit v1.2.3-59-g8ed1b