Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2190343ybm; Thu, 23 May 2019 12:51:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqyN/W4UWCBsfb5MDxK54wSi9O2ZgENsyIfIp0+59OoZphq6vwOHFTi9OPgIgC9DvnNDAs8t X-Received: by 2002:a17:90b:8d7:: with SMTP id ds23mr3749287pjb.138.1558641104476; Thu, 23 May 2019 12:51:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558641104; cv=none; d=google.com; s=arc-20160816; b=FB981rsupgQoBsCoZi+w+Hyjtny8ukxZnSRbrPaDpNUs3riq+2vqfcIOmJcspNiN9O UHHx2Xv2aEi6D62Gx+6fPVLu17+jeynUieTljTr5jWne5gx0HQZ7JGi4cmyjtAacYJNA CCTyHpBazcTgV26+tSyur8IvJ2RgKefP6PzKbY8CO5xnd6nVsBwk92FSYAD+r/h9afht Ryg1E2X3/bR9zKefrcfq0gXzJ88F1eDDnIMq0y37E7sEXIkf1Y6Tncs2sn80zxP2FnLn V+hjUeVnRoqJiSfZL+dfu1hUPn0BI18XqmzYJZt7Gk5pUl1Y1cJYIvFp1+N5ekIhi4Sv zwmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eyTlIUyuoURya4zUQKQH10qYZJXyTCLR3VNlhJh/PqE=; b=cux59o36LXs2jHxdQUjhVzn4MCS1xqo02O8FXsqVbq7uKY6kdGjthmpqQsANBpEnyY t1A7HK8w8glnsPDTGSTV1Y+HAe+LeGpvK/9lZmGL69UdCnWz5Io142G25BUqI/sz7L9r TVNU1AWOeAXRxeTrmzGqdg1nbKS6zqJUUaxXleXzc7Bh/UWwPM2oX6IW9PFLkzIanb0m K8spdAqBw4vc/bszywKrjFbljqKtTACqYhH1WSUrVCbxzqm/KS/wcngz/0A3xSWWwdfi zk0dh3loceIIgXucZYq3RggVIvUjTwrzHTeCe0BKtHa7YYjJk7nxngGU5HO46eFMb2Va IXdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vljZJj6Z; 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 h1si468294pjk.71.2019.05.23.12.51.28; Thu, 23 May 2019 12:51:44 -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=vljZJj6Z; 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 S2388011AbfEWTK4 (ORCPT + 99 others); Thu, 23 May 2019 15:10:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:44230 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387956AbfEWTKy (ORCPT ); Thu, 23 May 2019 15:10:54 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 58EFC2133D; Thu, 23 May 2019 19:10:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558638653; bh=4Iku/FjekZcjWFXaDe6eZYD6gS+UBEqFJtU66m3sppg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vljZJj6ZPykeetZpJ56ey/nlElpypx2rmFvBJ3FX627WhVT9iQsPaAfBZ6uwgX+nU bV2kuh8q6n8lvhPtUCGjWNiHGBpgOvnsj9rcyCBwLx+l5MqJGQPk6F7K3XicpSGmeG +Asqats1wVIzsDWniKIkkRp1b2jsO7iMIlDOa/ro= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tingwei Zhang , Sai Prakash Ranjan , Alexander Shishkin Subject: [PATCH 4.14 15/77] stm class: Fix channel free in stm output free path Date: Thu, 23 May 2019 21:05:33 +0200 Message-Id: <20190523181722.338591145@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181719.982121681@linuxfoundation.org> References: <20190523181719.982121681@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tingwei Zhang commit ee496da4c3915de3232b5f5cd20e21ae3e46fe8d upstream. Number of free masters is not set correctly in stm free path. Fix this by properly adding the number of output channels before setting them to 0 in stm_output_disclaim(). Currently it is equivalent to doing nothing since master->nr_free is incremented by 0. Fixes: 7bd1d4093c2f ("stm class: Introduce an abstraction for System Trace Module devices") Signed-off-by: Tingwei Zhang Signed-off-by: Sai Prakash Ranjan Cc: stable@vger.kernel.org # v4.4 Signed-off-by: Alexander Shishkin Signed-off-by: Greg Kroah-Hartman --- drivers/hwtracing/stm/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/hwtracing/stm/core.c +++ b/drivers/hwtracing/stm/core.c @@ -226,8 +226,8 @@ stm_output_disclaim(struct stm_device *s bitmap_release_region(&master->chan_map[0], output->channel, ilog2(output->nr_chans)); - output->nr_chans = 0; master->nr_free += output->nr_chans; + output->nr_chans = 0; } /*