From 3a8f9114fc09b35a26556a972e36811e144ea30f Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Wed, 24 Apr 2019 05:18:31 -0700 Subject: [PATCH] fatal: fix sm session usage --- stratosphere/fatal/source/fatal_task_screen.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stratosphere/fatal/source/fatal_task_screen.cpp b/stratosphere/fatal/source/fatal_task_screen.cpp index ab7937b6a..7202197ee 100644 --- a/stratosphere/fatal/source/fatal_task_screen.cpp +++ b/stratosphere/fatal/source/fatal_task_screen.cpp @@ -95,10 +95,7 @@ Result ShowFatalTask::PrepareScreenForDrawing() { Result rc = ResultSuccess; /* Connect to vi. */ - DoWithSmSession([&]() { - rc = viInitialize(ViServiceType_Manager); - }); - if (R_FAILED(rc)) { + if (R_FAILED((rc = viInitialize(ViServiceType_Manager)))) { return rc; } @@ -181,7 +178,10 @@ Result ShowFatalTask::ShowFatal() { Result rc = ResultSuccess; const FatalConfig *config = GetFatalConfig(); - if (R_FAILED((rc = PrepareScreenForDrawing()))) { + DoWithSmSession([&]() { + rc = PrepareScreenForDrawing(); + }); + if (R_FAILED(rc)) { *(volatile u32 *)(0xCAFEBABE) = rc; return rc; }