Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2934170ybf; Mon, 2 Mar 2020 19:04:10 -0800 (PST) X-Google-Smtp-Source: ADFU+vvepxX/uzKqTXUQUp3G+GxzY/suanBr4PVmZpetJ37ZQvBQ6QUucvgWGbTPjywI8vrXgDCx X-Received: by 2002:a9d:69d7:: with SMTP id v23mr1826717oto.40.1583204650810; Mon, 02 Mar 2020 19:04:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583204650; cv=none; d=google.com; s=arc-20160816; b=p19Yg6+GfGgoi5kP9LVOtMjSK6E8My3XulQastlm+lp7qjDPwjLoA/22aX/9GSrbNu WCqe6tvLOaHqezxqU77o5UX69UZ5cp7KPqGHhSyXzMmZr9KkCReOUvKam7QvCdZRbpXR H4BFtWxDIlnc8cC5x4stIfN/XZIeKPqot0/mWw3VeKYIju5bNIXmfdidhPd7YHbS6i+6 LQjsiHPY8dAcyDCeRxL5yBkPpJNSbr2E5Ddv8ukw5P6+xro9KLU5rLLKJeB5jHxgh9IU 8Q7ucArs3lQ2e+Gbn/FrJzlanvG3fvLRSoFB4GIJvJ7niqcIVxEOcEesS12/L5y+oxNZ ogeA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uovkwt1Ure0LKd1t5piiN7nQO7D+w6FwLRzmT7rLN9A=; b=sn+NvPo7rUJBB9jkSSBAnkZLjK/kMTkX32Zy5ZuvFR3H2I12RaJM/FJ1LRiFSuYK7M vAti+J9yDLBg/imSm3lusQNCrU4eu+aeLmAGWabxjwJF7yfy/aua/cjCSVj5r2EbTo67 G+q3mrRZ4osnr2Upe9VshElei2uuIGLS/jwpoZjYhlL9meTt0AIjglt6QfeyuETKxE8h UZ91l87R+FuaOVKFamf19ssxggEd/+ctBxuFcfN48meqezz1YDA43WoGV8isBcHJ+aP6 xh4QmujvlE0LcCO0Rra7vr8re4AhfgltJo1k4WDzZC+RZuUhnUwd6YB6eiFNG3Ov+LyG iMUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Eu5Qo2r/"; 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 h203si7054901oif.3.2020.03.02.19.03.59; Mon, 02 Mar 2020 19:04:10 -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; dkim=pass header.i=@kernel.org header.s=default header.b="Eu5Qo2r/"; 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 S1727526AbgCCCqf (ORCPT + 99 others); Mon, 2 Mar 2020 21:46:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:40858 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727474AbgCCCq3 (ORCPT ); Mon, 2 Mar 2020 21:46:29 -0500 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 292BC24681; Tue, 3 Mar 2020 02:46:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583203588; bh=dZ6Es09tqYlqTLzTZe2PRZ3vS+0hQayTcGbsSTWc8FE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Eu5Qo2r/JiR3eUjQDnI3GjDJcnEN0PnSVNRRSPj6MjXSKDuhes4oczMZDfFoAWKiA e8pmezOfWbkwxHYkrGm+ufiuAuDoM9LqhImR+05lEytJXeWH1TbrS9mn0WsPa0SoEi gj/9Th/9BQuHn34Hiy2wNpxYn5XCSslB5mDJYTTw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Oded Gabbay , Sasha Levin Subject: [PATCH AUTOSEL 5.5 11/66] habanalabs: patched cb equals user cb in device memset Date: Mon, 2 Mar 2020 21:45:20 -0500 Message-Id: <20200303024615.8889-11-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200303024615.8889-1-sashal@kernel.org> References: <20200303024615.8889-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oded Gabbay [ Upstream commit cf01514c5c6efa2d521d35e68dff2e0674d08e91 ] During device memory memset, the driver allocates and use a CB (command buffer). To reuse existing code, it keeps a pointer to the CB in two variables, user_cb and patched_cb. Therefore, there is no need to "put" both the user_cb and patched_cb, as it will cause an underflow of the refcnt of the CB. Signed-off-by: Oded Gabbay Signed-off-by: Sasha Levin --- drivers/misc/habanalabs/goya/goya.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c index f24fe909b88d8..b8a8de24aaf72 100644 --- a/drivers/misc/habanalabs/goya/goya.c +++ b/drivers/misc/habanalabs/goya/goya.c @@ -4690,8 +4690,6 @@ static int goya_memset_device_memory(struct hl_device *hdev, u64 addr, u64 size, rc = goya_send_job_on_qman0(hdev, job); - hl_cb_put(job->patched_cb); - hl_debugfs_remove_job(hdev, job); kfree(job); cb->cs_cnt--; -- 2.20.1