Skip to content

Commit 53e8a35

Browse files
committed
fix drvier detection
Signed-off-by: cocafe <[email protected]>
1 parent 23760d0 commit 53e8a35

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

main.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,13 @@ static int physmem_rw(void)
319319
HANDLE map_hdl;
320320
uint8_t *virt_addr;
321321

322+
if (!is_inpoutx64_driver_open()) {
323+
pr_err("Failed to open Inpoutx64 driver\n");
324+
inpoutx64_deinit();
325+
326+
return -EIO;
327+
}
328+
322329
if (rw_sz == 0)
323330
return 0;
324331

@@ -420,12 +427,6 @@ int wmain(int wargc, wchar_t *wargv[])
420427
return err;
421428

422429
inpoutx64_init();
423-
if (!is_inpoutx64_driver_open()) {
424-
pr_err("Failed to open Inpoutx64 driver\n");
425-
inpoutx64_deinit();
426-
427-
return -EIO;
428-
}
429430

430431
switch (cmd) {
431432
case CMD_READ:

0 commit comments

Comments
 (0)