From patchwork Wed Oct 19 08:31:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5196 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp264079wrs; Wed, 19 Oct 2022 04:19:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6yRksjrtYS2jY9hKJiSq+U+yIL4/y+TTE3FSK+p5BjgZuZhrDyXVBlJdkL+ZAYNmp9W7gc X-Received: by 2002:a17:907:7b95:b0:731:113a:d7a2 with SMTP id ne21-20020a1709077b9500b00731113ad7a2mr6003514ejc.377.1666178359781; Wed, 19 Oct 2022 04:19:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666178359; cv=none; d=google.com; s=arc-20160816; b=E6zls3fR45Xn//KPHXqWUOVyq0YICHXoQ3Axp25JnOyiRK0daTJz0Exc0zJPCIS1D0 Saqx1MhtrN6lJK3FzDHzT1EP6ww+Uz5ZLNWK5sO2ZfGX1qeRyieyWJEyBYUWygTBVUiN Ko5mpCG6WugXk5HspP5c3zQ53LzdbTvpmnqVzgqDsRXq4DtShoCsz/haqjqLQULtXlPK TL9RaQ+rPn01HQ6iYXYhrxIoOCA2yKZgUYnJaaWlMvhXGEMu4PWQoYJcrg+j1baCqdEm I545C5/K/HKHSs2BHh4hSEuBOHrvS+v61EPJYnUrkhJJUFqPdhbW2jnzo0ApR8LVpi2T ApJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hkS6lt0tSUmOCBE/qe8xCvEGIF09qTogxUNedvXX42U=; b=XXduta/UMJZJ0uC1SK0kG7kOjl8CYX/ApxIs2jfJy96bRkB3zwLggPMLI5rKlzqoWl x6g447QpIrDYMdYqlUuxS+V3QShQu8mLwXmXarqDlaGv08NmuAC2thOh55vtMOB/cw+I puchrAApalbBPaQrIpIhI63yaxz/aDlHUM6ySYSlbKQl7x6pstIcFn0KvayTn+CA9gj5 0hnccGsf/QWpikaGpqGinIMzncq/zOpIyexLeTqKVJ/qEmNAciLLpV8RG11TKaiexR7l bf4z+UgL36HD6v0/jGgypFgGqm2k7uRuC76atsN1sgr6zib+ny5gcMyAU6oEwVBQu3Wl GZGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bEDtTLHP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h13-20020a05640250cd00b00458ac23f0b8si16427490edb.399.2022.10.19.04.18.45; Wed, 19 Oct 2022 04:19:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bEDtTLHP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230059AbiJSLIn (ORCPT + 99 others); Wed, 19 Oct 2022 07:08:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230315AbiJSLIZ (ORCPT ); Wed, 19 Oct 2022 07:08:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF8A517C54B; Wed, 19 Oct 2022 03:37:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 59B99B82330; Wed, 19 Oct 2022 09:06:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A85EBC433D6; Wed, 19 Oct 2022 09:06:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170380; bh=OgPtLTEGfETYUPU1GzT7ZQ6ful3QMszIFbtSxZ1yJ50=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bEDtTLHPgcTPK0K9Ey5nzF55l7+jGtBDWS56g2ZwsBiDiYjLUeyit8Ue5YYoUb2uT etB7L2Z+DY0QtBHHIYsV/yX1Rr/527NoKhNkxhOw0Ckb1W4Vun5fgnkMhXwpX/I/Uh WBbGSYio/g/jsaJ/7ExKjBaVMezNNvY/X7PGvUs8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Weili Qian , Herbert Xu , Sasha Levin Subject: [PATCH 6.0 632/862] crypto: hisilicon/qm - fix missing put dfx access Date: Wed, 19 Oct 2022 10:31:59 +0200 Message-Id: <20221019083317.852065606@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747114639734512846?= X-GMAIL-MSGID: =?utf-8?q?1747114639734512846?= From: Weili Qian [ Upstream commit 5afc904f443de2afd31c4e0686ba178beede86fe ] In function qm_cmd_write(), if function returns from branch 'atomic_read(&qm->status.flags) == QM_STOP', the got dfx access is forgotten to put. Fixes: 607c191b371d ("crypto: hisilicon - support runtime PM for accelerator device") Signed-off-by: Weili Qian Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/hisilicon/qm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index ad83c194d664..9fa2efe60153 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -2245,8 +2245,10 @@ static ssize_t qm_cmd_write(struct file *filp, const char __user *buffer, return ret; /* Judge if the instance is being reset. */ - if (unlikely(atomic_read(&qm->status.flags) == QM_STOP)) - return 0; + if (unlikely(atomic_read(&qm->status.flags) == QM_STOP)) { + ret = 0; + goto put_dfx_access; + } if (count > QM_DBG_WRITE_LEN) { ret = -ENOSPC;