Message ID | 20230602210440.8411-2-quic_jhugo@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1302378vqr; Fri, 2 Jun 2023 14:09:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7wncfRqDqDxvVF8g538ywejzIJLONcIYYPSg1hrunRkzXpldaK93fp51sLu9s3mmyycxB2 X-Received: by 2002:a05:6358:52d3:b0:123:3812:7caa with SMTP id z19-20020a05635852d300b0012338127caamr15165516rwz.24.1685740159741; Fri, 02 Jun 2023 14:09:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685740159; cv=none; d=google.com; s=arc-20160816; b=EF3Hs6nvzzlWOagcs1/fF0WSD6cH89vuwophnTGo44E9sC/FP+4I6BxsacjcUgdX8R 3gfnRv4xgdheR+qmd9ToBj/mhZHx+dYierafs+vJNLXXyPEdM95zjBVkvfHwaUYetlpx 3lw906liqHVzLK5L0M4g1EgBrkfs/MrJotBqCPKWeDKmMKBgx0l9dEuVKM8ZZbI4nVPG xg7Ye0xzlc+YfeZGGjvqiBoEBsogS3f+9rL96B0/XlOZwz8dWxjwvbJM7OeVXQpMcTMI Gt2kPtIWrgMlL6HIZ02RB/2cdT4QVCQVP3RX1pDdOzU65cfrre7yjDvMBQUzXFSlvz3P nN+g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2t5Q8jvXuR0HuNXjcwpUz4E1BgD0D0RZFqnR78v/kig=; b=abZK3PPkKFebkVQ4VN3XrM+Omhai6qCDcR3vLhOmGsuolLq1rFMWrZWMj6dIy2YzFV ba4mLz2TC3pg3qvUr05Pobd8tzkaL/Zv2/mzustE9eMUFWRQkFVYt2kB6VH9YhbDM72k LpVzE2oVBuylahO+F5/kWiYA1a77IUwb3VvnyDiBKq+/W3dM3l1FmuwZQ8c4/irjGL8k zHUFZLBdcw16ZmTj1Ng0MAYpDNdHrZHfMCvV+2YB41LDiYLKbLpc943z9UjalEb4XqIX B3vZbNWx8wqBh33sOwpP2ox2+N0e/HPKVFgzRvO2N11F9qbgwLvlmSITQFuGCk+ibNe1 BNWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=P6MmjXCl; 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=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l7-20020a63be07000000b005303a26dbf8si1496288pgf.408.2023.06.02.14.09.04; Fri, 02 Jun 2023 14:09: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=@quicinc.com header.s=qcppdkim1 header.b=P6MmjXCl; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236445AbjFBVFG (ORCPT <rfc822;limurcpp@gmail.com> + 99 others); Fri, 2 Jun 2023 17:05:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236169AbjFBVFC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 2 Jun 2023 17:05:02 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC175E45; Fri, 2 Jun 2023 14:05:01 -0700 (PDT) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 352J64Zk017098; Fri, 2 Jun 2023 21:04:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=2t5Q8jvXuR0HuNXjcwpUz4E1BgD0D0RZFqnR78v/kig=; b=P6MmjXClbQURaSRy0DOb53/uEdUMoU5z6HbGbQaXTyf2HWO2aP8Zk+v5DBA74CF43xw8 STDcMTFwh4Z4muPU0x1wdBSSx77rxrRvi9InOFk4+0uu4imRDtBHXIMyxvXDjxegG4x8 PjhJAA2dTtTrs9YDaWST+h+no6tejNtVY0JStN9ZkLqb6HCw+W+c6t/Gr2RQlAhr0AhJ 6EXVNQrpX9PiP6nUR46jIMZq7e4E3vaU6dh7lDy2I3HsdKziBL4aBeKpDJxEQySXDJfK DGPQgeGbrwOUzmR4NfUDjk1Fz7nsB3JGTt6rZ8d+XtFyHoOB+Ete8VE+YnmATQ5RnlkR SQ== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qydr5hg98-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 02 Jun 2023 21:04:59 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 352L4w4O031397 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 2 Jun 2023 21:04:58 GMT Received: from jhugo-lnx.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Fri, 2 Jun 2023 14:04:57 -0700 From: Jeffrey Hugo <quic_jhugo@quicinc.com> To: <dri-devel@lists.freedesktop.org> CC: <ogabbay@kernel.org>, <jacek.lawrynowicz@linux.intel.com>, <stanislaw.gruszka@linux.intel.com>, <quic_carlv@quicinc.com>, <quic_ajitpals@quicinc.com>, <linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>, Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com>, Jeffrey Hugo <quic_jhugo@quicinc.com> Subject: [PATCH 1/2] accel/qaic: Free user handle on interrupted mutex Date: Fri, 2 Jun 2023 15:04:39 -0600 Message-ID: <20230602210440.8411-2-quic_jhugo@quicinc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230602210440.8411-1-quic_jhugo@quicinc.com> References: <20230602210440.8411-1-quic_jhugo@quicinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: lPDFZuZdp3vIIgEoLI4N_rFVa-vkrqF9 X-Proofpoint-GUID: lPDFZuZdp3vIIgEoLI4N_rFVa-vkrqF9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-02_16,2023-06-02_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 adultscore=0 clxscore=1015 mlxscore=0 spamscore=0 mlxlogscore=893 priorityscore=1501 suspectscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2306020163 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767626673733236534?= X-GMAIL-MSGID: =?utf-8?q?1767626673733236534?= |
Series |
accel/qaic fixes for 6.4 part 2
|
|
Commit Message
Jeffrey Hugo
June 2, 2023, 9:04 p.m. UTC
From: Carl Vanderlip <quic_carlv@quicinc.com> After user handle is allocated, if mutex is interrupted, we do not free the user handle and return an error. Kref had been initialized, but not added to users list, so device teardown would also not call free_usr. Fixes: c501ca23a6a3 ("accel/qaic: Add uapi and core driver file") Signed-off-by: Carl Vanderlip <quic_carlv@quicinc.com> Reviewed-by: Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com> Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com> Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com> --- drivers/accel/qaic/qaic_drv.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/accel/qaic/qaic_drv.c b/drivers/accel/qaic/qaic_drv.c index 2d0828db28d8..961cd341b414 100644 --- a/drivers/accel/qaic/qaic_drv.c +++ b/drivers/accel/qaic/qaic_drv.c @@ -97,6 +97,7 @@ static int qaic_open(struct drm_device *dev, struct drm_file *file) cleanup_usr: cleanup_srcu_struct(&usr->qddev_lock); + ida_free(&qaic_usrs, usr->handle); free_usr: kfree(usr); dev_unlock: