[lkml]   [2019]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 3.16 057/305] Drivers: hv: kvp: Fix two "this statement may fall through" warnings
3.16.63-rc1 review patch.  If anyone has any objections, please let me know.


From: Dexuan Cui <>

commit fc62c3b1977d62e6374fd6e28d371bb42dfa5c9d upstream.

We don't need to call process_ib_ipinfo() if message->kvp_hdr.operation is
KVP_OP_GET_IP_INFO in kvp_send_key(), because here we just need to pass on
the op code from the host to the userspace; when the userspace returns
the info requested by the host, we pass the info on to the host in
kvp_respond_to_host() -> process_ob_ipinfo(). BTW, the current buggy code
actually doesn't cause any harm, because only message->kvp_hdr.operation
is used by the userspace, in the case of KVP_OP_GET_IP_INFO.

The patch also adds a missing "break;" in kvp_send_key(). BTW, the current
buggy code actually doesn't cause any harm, because in the case of
KVP_OP_SET, the unexpected fall-through corrupts
message->, but that is not really used: see
the definition of struct hv_kvp_exchg_msg_value.

Signed-off-by: Dexuan Cui <>
Cc: K. Y. Srinivasan <>
Cc: Haiyang Zhang <>
Cc: Stephen Hemminger <>
Signed-off-by: K. Y. Srinivasan <>
Signed-off-by: Greg Kroah-Hartman <>
Signed-off-by: Ben Hutchings <>
drivers/hv/hv_kvp.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

--- a/drivers/hv/hv_kvp.c
+++ b/drivers/hv/hv_kvp.c
@@ -326,7 +326,6 @@ static void process_ib_ipinfo(void *in_m

out->body.kvp_ip_val.dhcp_enabled = in->kvp_ip_val.dhcp_enabled;

- default:
utf16s_to_utf8s((wchar_t *)in->kvp_ip_val.adapter_id,
@@ -379,7 +378,7 @@ kvp_send_key(struct work_struct *dummy)
process_ib_ipinfo(in_msg, message, KVP_OP_SET_IP_INFO);
- process_ib_ipinfo(in_msg, message, KVP_OP_GET_IP_INFO);
+ /* We only need to pass on message->kvp_hdr.operation. */
case KVP_OP_SET:
switch (in_msg-> {
@@ -419,6 +418,9 @@ kvp_send_key(struct work_struct *dummy)

+ break;
case KVP_OP_GET:
message-> =
 \ /
  Last update: 2019-02-03 15:29    [W:0.715 / U:3.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site