[PATCH 3.16 280/328] tools: hv: fcopy: set 'error' in case an unknown operation was requested

Ben Hutchings
2018-12-09T22:02:11Z

From: Vitaly Kuznetsov <vkuznets@redhat.com>

commit c2d68afba86d1ff01e7300c68bc16a9234dcd8e9 upstream.

'error' variable is left uninitialized in case we see an unknown operation.
As we don't immediately return and proceed to pwrite() we need to set it
to something, HV_E_FAIL sounds good enough.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
tools/hv/hv_fcopy_daemon.c | 1 +
1 file changed, 1 insertion(+)

--- a/tools/hv/hv_fcopy_daemon.c
+++ b/tools/hv/hv_fcopy_daemon.c
@@ -184,6 +184,7 @@ int main(void)
break;

default:
+ error = HV_E_FAIL;
syslog(LOG_ERR, "Unknown operation: %d",
in_msg->operation);