proto-shell: return error in case setup fails
authorHans Dedecker <dedeckeh@gmail.com>
Mon, 1 Apr 2019 11:53:50 +0000 (13:53 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Mon, 1 Apr 2019 20:56:23 +0000 (22:56 +0200)
In case PROTO_CMD_SETUP cannot be handled due to an invalid state; return
-1 so the calling functions are aware the PROTO_CMD_SETUP has failed.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
proto-shell.c

index 9653f4c8b9b13958d32998b0fa6cece86008d25b..47a9568b290553c8e28ecb1efd34b9c3f98a2daf 100644 (file)
@@ -181,11 +181,6 @@ proto_shell_handler(struct interface_proto_state *proto,
                        state->sm = S_SETUP;
                        break;
 
-               case S_SETUP_ABORT:
-               case S_TEARDOWN:
-               case S_SETUP:
-                       return 0;
-
                default:
                        return -1;
                }