Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3001878imu; Sun, 9 Dec 2018 14:48:36 -0800 (PST) X-Google-Smtp-Source: AFSGD/Ww/mskVv4ivO2E91/Ce/BCw56lbTD18go0fzAWGynUO5lGbDcMfDd0paJvEp0pkwwrquBc X-Received: by 2002:a62:de06:: with SMTP id h6mr10461278pfg.158.1544395716592; Sun, 09 Dec 2018 14:48:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544395716; cv=none; d=google.com; s=arc-20160816; b=Os2NEVILne/cvnxzS6tg8px2oGuOmmhE3SyDgAV/yQplJCJRBSWNmw5Qx2sIdl/Tzf fkpVYk+L9xRV6Kcx3GrEVdMcXwdcPdLW0UFsLFIPIO2EUnro/IqgOOSr20YFJU7JsUcD KjK8aOCwnzBWTAiie9EwSG+Bz+pZbl3ZqQqQptwlhnyCdI0jUSotpAhW9qkM7str2tmh F6A3fhylDWO3NnjWR+8Qsz1tB/Inv9jE+HlS6HSzQgLGRhKM4I5PcIaGUfwIcnPDbri7 2KvejXOlkkE3mAp62Bzgbc4SB2dLuwruDe7PrDxNS5nDDJR9JMfCp0JchVAAXc8lb0MV 1x8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=ibLSuLsGEVTgP3y1Dq+QiCUNjbD+dOz8ZD0/hJU0oPc=; b=bZqceve09Iq+Z6+ahUXbqblAxG+jmw9Y13SSr9on/bbEdvI1XL1C8IgllikU48asCA mJorx8y0X6HU9E8mwh8UGIQsj0y1P4mxz1+t0gwHP9L1goKpDudJuUNDauqfzp9mgnOe VK5wpPzR0EMmrtNd7+NgH5rFTNSRo2yf66W1KvPyGsAQRQqyfrd5mBCP+ewoAax885R9 xchcZ792bZjxO/6P/aWHAFdRxFKqLOQcvQNJWweAbRPOWI+uKWD8UBcMHLz6+jyfz0L5 TT10/ZLWK6BTNnViLFSDboMNFpIvAhVDPKJF+h1jOLsnfK3lSvJJEE4WUNiSfcy/77Jt TDpg== 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 j10si5690912plg.123.2018.12.09.14.48.21; Sun, 09 Dec 2018 14:48:36 -0800 (PST) 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 S1727014AbeLIV7Z (ORCPT + 99 others); Sun, 9 Dec 2018 16:59:25 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:36184 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726741AbeLIVzi (ORCPT ); Sun, 9 Dec 2018 16:55:38 -0500 Received: from pub.yeoldevic.com ([81.174.156.145] helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gW730-0002im-Bw; Sun, 09 Dec 2018 21:55:35 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gW72h-0003Z8-OG; Sun, 09 Dec 2018 21:55:15 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "David Binderman" , "Greg Kroah-Hartman" , "Michael Kelley" , "K. Y. Srinivasan" Date: Sun, 09 Dec 2018 21:50:33 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 234/328] Tools: hv: Fix a bug in the key delete code In-Reply-To: X-SA-Exim-Connect-IP: 81.174.156.145 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.62-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: "K. Y. Srinivasan" commit 86503bd35dec0ce363e9fdbf5299927422ed3899 upstream. Fix a bug in the key delete code - the num_records range from 0 to num_records-1. Signed-off-by: K. Y. Srinivasan Reported-by: David Binderman Reviewed-by: Michael Kelley Signed-off-by: Greg Kroah-Hartman Signed-off-by: Ben Hutchings --- tools/hv/hv_kvp_daemon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/tools/hv/hv_kvp_daemon.c +++ b/tools/hv/hv_kvp_daemon.c @@ -289,7 +289,7 @@ static int kvp_key_delete(int pool, cons * Found a match; just move the remaining * entries up. */ - if (i == num_records) { + if (i == (num_records - 1)) { kvp_file_info[pool].num_records--; kvp_update_file(pool); return 0;