Skip to content

Commit e88d210

Browse files
authored
Merge pull request #469 from CodeConstruct/action-warn-fix
examples/mi-mctp: fix warning for possibly uninitialised variable
2 parents bd08e22 + 86fcc75 commit e88d210

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

examples/mi-mctp.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,12 @@ static int do_action_endpoint(enum action action, nvme_mi_ep_t ep, int argc, cha
661661
case ACTION_CONFIG_SET:
662662
rc = do_config_set(ep, argc, argv);
663663
break;
664+
default:
665+
/* This shouldn't be possible, as we should be covering all
666+
* of the enum action options above. Hoever, keep the compilers
667+
* happy and fail gracefully. */
668+
fprintf(stderr, "invalid action %d?\n", action);
669+
rc = -1;
664670
}
665671
return rc;
666672
}

0 commit comments

Comments
 (0)