Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1888380imm; Sun, 23 Sep 2018 14:12:45 -0700 (PDT) X-Google-Smtp-Source: ACcGV63BAVBfBo7nrxKu2mtMckRE6Wb0I8SYGcVLq/cHpqgCL72CkD+zuSuoj0W0iuDgi1Qn5oxg X-Received: by 2002:a17:902:654b:: with SMTP id d11-v6mr7948079pln.8.1537737165045; Sun, 23 Sep 2018 14:12:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537737165; cv=none; d=google.com; s=arc-20160816; b=KN9sL9JuNE5bZcOxLVHhRtn97Avczy28a5MIUqdR3eXFi1mKjBcm3miW5vVuixVRe1 K0TpPcMGCPuF5ipON14zPw326esHyLmcKlhMfwVnJEf6REAlDTHitYGCES1bTU+QzEhq DwbUEJH+/mDmB21SFIVbpBOmvdUTIbUnDshjsmwEtQ+1xa4Q8tEzF4dOi3lFfLuFwfBA Xdeu39ECvAaDZ7d6Jh7/nOeCM2paF8ZPo42FZyWDvs8MDR0EPyXuOZQtrB+Wcw6bHG89 Z7qALO7SXNNo51MCWHFXGXiqOwYA3az/HzPvK2OOkC6KgHo4sEfbH6DNmvQujqNBkkux Wh/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:reply-to:references:in-reply-to :message-id:date:subject:cc:to:from; bh=utZAGBqcrf3imFy9SIfebclm7yQH/hmo2WNjUN3oOq4=; b=dly+2Fagwo9baUeXgrEKUsspP9JwFmT9kGUv12kfNkURv1qwRR6JI2oxBbGYL6C3jv QKW0OI/NteiIsjc704YusA7ESkQSLfDT+eftK3ikA0qHtTUb3VolRntPLifupBEadKqi S3LArXUJBOBLFyzMPe2FP12AslWvYRHH8780FH3fb67nncTqgsc2GngGLKuM3vq0Lg0M lIA6YZ5msPP+urX5orPeB3AnT8per4QEfy8JxY4h+MyphlEwM3qEyYF9Hm9vIp3JNiJH 3R4/XbPAZ9mkuL1MZPkaQ34J8xeF2x4XPqnWuL4RLZXu8/yvmdb5n4bJoy+p3cCuEE4F Cj3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3-v6si33924357plb.68.2018.09.23.14.12.30; Sun, 23 Sep 2018 14:12:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727264AbeIXDKm (ORCPT + 99 others); Sun, 23 Sep 2018 23:10:42 -0400 Received: from a2nlsmtp01-05.prod.iad2.secureserver.net ([198.71.225.49]:39552 "EHLO a2nlsmtp01-05.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727139AbeIXDKl (ORCPT ); Sun, 23 Sep 2018 23:10:41 -0400 Received: from linuxonhyperv2.linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with ESMTP id 4BeQgoiWisezk4BeQgk9gW; Sun, 23 Sep 2018 14:10:46 -0700 x-originating-ip: 107.180.71.197 Received: from kys by linuxonhyperv2.linuxonhyperv.com with local (Exim 4.91) (envelope-from ) id 1g4BeP-0007HH-S6; Sun, 23 Sep 2018 14:10:45 -0700 From: kys@linuxonhyperv.com To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com, sthemmin@microsoft.com, Michael.H.Kelley@microsoft.com, vkuznets@redhat.com Cc: Dexuan Cui , "K . Y . Srinivasan" , Haiyang Zhang , Stable@vger.kernel.org Subject: [PATCH 3/4] Drivers: hv: kvp: Fix two "this statement may fall through" warnings Date: Sun, 23 Sep 2018 21:10:43 +0000 Message-Id: <20180923211044.27922-3-kys@linuxonhyperv.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180923211044.27922-1-kys@linuxonhyperv.com> References: <20180923210938.27859-1-kys@linuxonhyperv.com> <20180923211044.27922-1-kys@linuxonhyperv.com> Reply-To: kys@microsoft.com X-CMAE-Envelope: MS4wfGL/VmB8lC2Co1lkZ52Slf/WMpK9yEDR9q5mMwmY8KxKmXJo8VyPcEelL+795/DEKSeFXUMAaNAD09LBKAQSNBaB4qI/p6A3ZFhBGVDFTfbYS5LqB/Xc y0Z1uAyS7dpGYI7eg32pO6a3t5D+puaEOMIUklureZqseZ+Q/KCUjOzawwnZ08yp0aQUindeVlNoiG1whlDIQheCLM0KXZwSsDct3+6sjytG0YhDbfN5MJcO VKfgi/4r0jsJ6KMO4SKPDLqyfYdl0PD4slUCI9EvMxLAyiWUhElfr1YT2xTEzwAlMzAHnNzGFT/sYQiHzcXLL5BRc0iMAHl1LVoPXu7OqWRAHeCWJieJAYgY Jfl4rWa/d3uZEeX+EWMve3kGE2cAxYiKfyIFSmlaIoTkQ1A5CcYoDTc+qyu6msfJBiEYxDWhvvLHb6oFrnl/FK+Gh8b7Qa6UDnvDuofdbJJk7bpeMx9MeWOZ acb7EcfonFapqGzcDvmjpvXQOPU6xvJ3TsvdNBmQ05mTEUueLU0jwe0uY2WaCSzVAKwnswb/qB6pm3wM9s3U9YbRMjoeo0XnKNGk/HXOVngDar7U69FUj1Um Isi9WXXv76Jz6CUXBGVshMnkYQ5aM5airPBcma47e6CCIQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dexuan Cui 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->body.kvp_set.data.key_size, 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 Cc: Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_kvp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c index 023bd185d21a..a7513a8a8e37 100644 --- a/drivers/hv/hv_kvp.c +++ b/drivers/hv/hv_kvp.c @@ -353,7 +353,6 @@ static void process_ib_ipinfo(void *in_msg, void *out_msg, int op) 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, MAX_ADAPTER_ID_SIZE, UTF16_LITTLE_ENDIAN, @@ -406,7 +405,7 @@ kvp_send_key(struct work_struct *dummy) process_ib_ipinfo(in_msg, message, KVP_OP_SET_IP_INFO); break; case KVP_OP_GET_IP_INFO: - process_ib_ipinfo(in_msg, message, KVP_OP_GET_IP_INFO); + /* We only need to pass on message->kvp_hdr.operation. */ break; case KVP_OP_SET: switch (in_msg->body.kvp_set.data.value_type) { @@ -446,6 +445,9 @@ kvp_send_key(struct work_struct *dummy) break; } + + break; + case KVP_OP_GET: message->body.kvp_set.data.key_size = utf16s_to_utf8s( -- 2.18.0