Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp171292imd; Wed, 31 Oct 2018 16:45:27 -0700 (PDT) X-Google-Smtp-Source: AJdET5dzSiwlOKqpYONjsZkDkH6UR5NofcYaWy7mad3doHnZJZAX6YNorYbGeCQApxzgY9G2wiV/ X-Received: by 2002:a65:64d5:: with SMTP id t21-v6mr5140060pgv.428.1541029527770; Wed, 31 Oct 2018 16:45:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029527; cv=none; d=google.com; s=arc-20160816; b=aS+ldJXKUmiRsjkLy6IOHhW68ttdZYcnnjukoA3eR+iG8gN/DciUc6PCuWLeTl/UDM tHxBQ5oTdC0pcuW/zwTcltN43hr02XHXAUXcbCC+JO6NTDotKqXgvXlJ2UQNth5/4bKZ YF7MB2MA5qDrHfLkcv3UasWPUIUzJaeb5Aepjg4YV7AO6im9MfvwIXVTR6OQQ3uVpiqV orGLrZWz1bxvWeP6ylKQwnQT3etCXkeSGICLQDOo4zPOFK0/PbFEPZZlnBLN5Xm46ow3 5C6x9JR1nHx1zDS6aViYqRaRI7EYrppnp1hFLJg11L1xa+XF1BNNpI9tsfFZSaX0Kbl1 NyYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=L0HNWq/DF0ImPOmXut+ncnlTwIpAX+WqZZmYCRG/4KQ=; b=XcTcGYqdFVRp48MDIbly/A83TYEQdxshNVXEIRWIoHhCSSYdG+LNnZvU393cYviZuM 5NlwHBMRdZIC48W9SUNJj2eBBDq03lhzr1JZj/j3oMQDJ/AQ/E0PsL2+FvIY+1rwcVCL YwjwJNwWgow48NZLR2W/X3uthi0Z7mxq3KyKIgZHMV6TyMnNsSCXBq1e+D9iA4suwfmx v85KPDjhxj2sOPmibhzhFaVBuHYBRxKnA15ySwm6QEn7nflj5DBN6r+3k26bI9d32oYU LfFnU9LvTzuoqj69zuWGX8Rz+lkc+NI9ypM0wB15ulIm2A5hCttlzAA2EI/khGq0mJRl uo+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fd7K3c0p; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p3-v6si6155197pff.272.2018.10.31.16.45.13; Wed, 31 Oct 2018 16:45:27 -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; dkim=pass header.i=@kernel.org header.s=default header.b=fd7K3c0p; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729144AbeKAIpM (ORCPT + 99 others); Thu, 1 Nov 2018 04:45:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:55386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728948AbeKAIHb (ORCPT ); Thu, 1 Nov 2018 04:07:31 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 323A220664; Wed, 31 Oct 2018 23:07:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027241; bh=7rU3CT/K4Vz5EVwVCBxraRVK9bYBIoBpjI/z4XCXqQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fd7K3c0pzgleFwS3lBLQC6IWnc4Opw/Q2rwZny3pk6MCn6Dd2VxbLl6fleclEwild BziADdntqwlJCXIcVgilGLXowS/Yk0YSN6x37T0QTxs69hqWL1RsWBHPpiq7t4Rjig TaFSv0ZudEGi1JKakEZ6wptXdw+h/pNN+PgVzkXM= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dexuan Cui , "K . Y . Srinivasan" , Haiyang Zhang , Stephen Hemminger , Stable@vger.kernel.org, Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL 4.19 109/146] Drivers: hv: kvp: Fix two "this statement may fall through" warnings Date: Wed, 31 Oct 2018 19:05:04 -0400 Message-Id: <20181031230541.28822-109-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dexuan Cui [ Upstream commit fc62c3b1977d62e6374fd6e28d371bb42dfa5c9d ] 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 Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- 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 5eed1e7da15c..57715a0c8120 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.17.1