Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7202169rwl; Mon, 9 Jan 2023 20:01:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXuDqNnm1L37Nj85RqIOoNBkN0JbtCmfQlV9U8kYmzxW2GiEjhgqr8ZSj8DsAhnP3KE4RBGr X-Received: by 2002:a05:6a20:8f21:b0:af:88d2:33f8 with SMTP id b33-20020a056a208f2100b000af88d233f8mr124925161pzk.7.1673323315300; Mon, 09 Jan 2023 20:01:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673323315; cv=none; d=google.com; s=arc-20160816; b=LAtltRId1vHcWTm0Tau1CRWL5grBLEU8kqKxiXsrUDAt0Jj6e9Ncju7CIoSMUGSkQs Bl2rJSMjZFPGD2AZtmf3mP3Bqxtz7GsM/4dKclpRwRaGHaQMrjEGkGN0J4xnVs/PiPc/ 4ZdmBdR+Gbm3jd0K8emiy+uSvASFyiCoggrH7jrIHdok9Bc95LXeq6JW6s/wDC8/hHzO Y/ZDHGbTvGTwJgLnCxHCQ7/V9Sygs/sB4uStBokDnW58wod/RS7Lmg2YpigHmgv5xkT2 5RYZ4fFsi1VITwc1zZOGoqQOmE+tFw6tXqAhPyy61f46cKtcQ8D/rTBXNR6gE1kWTLZM bnQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=OkY7mu9pdN8NmbL3lvH8cVGDqojl/7SParZy8RkcbCs=; b=tO+ecbztE185CwEF4gOHoNvfF/3kiryzpuOJb5kBiujlxpPyYDQkudie3vu3/iRBqs PLh/7bZR6n2QnKfhjteOdFIr2vAugrWrnnaazdOfvh3pJ07iEal/VEDFFIAFawsy08ui m0RqX1DX0v+0u58GfWOn3fNFbD1UeRZeBvxjW3HjMIExlhjB+Bv2gMVyDK0JJJSwBaFN evyp5BNlBchbkCrVY/6kdQU0wTQWM8jPaHy2xoBRSQegGbMk/zAJEK20QBLMu+woLHXV ccyXa3TkKzjphDv6xZ+fyT2vi71yllZzt6WyXOTxqvSXYpoTOSCrB3vbAPESgRUiRqsR icHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=nN2FqaE+; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v29-20020a63b95d000000b004b40e359a67si3150306pgo.588.2023.01.09.20.01.48; Mon, 09 Jan 2023 20:01:55 -0800 (PST) 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=nN2FqaE+; 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 S229978AbjAJDbR (ORCPT + 53 others); Mon, 9 Jan 2023 22:31:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229559AbjAJDbQ (ORCPT ); Mon, 9 Jan 2023 22:31:16 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B4A11DDFD; Mon, 9 Jan 2023 19:31:15 -0800 (PST) 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 30A3MRMo000359; Tue, 10 Jan 2023 03:30:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=OkY7mu9pdN8NmbL3lvH8cVGDqojl/7SParZy8RkcbCs=; b=nN2FqaE+MTzvTOznotXZvRGyt5REh99OMh5InY+6d6semsH7X7J8s0lCpyxtXodFm77Y uCa3vdYXqq7dmNak/4MiLwR9nfP0QdyfT+NSdGiuEwGRPsz6ne6OP6Vb889F2T/jErhm 6SHlaEyJ2L9ejPJtViwg6PDvYmF1dj1roc0Loplsm++15jGuDz373RssMzlDxq2ql1xQ sEjqu1SSdqPYZX0JgDeUm935lbPrQ2A5fyk1KtexvfXB23ZSjt1awF7bLoy3gky07HH4 50+WVPQPUHOlubxhdzjQG1FxtzsdOFtPKCsm6AApE/x6EVTLfLSxttRonb+lu7WW++xZ ug== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3n0q28h0am-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Jan 2023 03:30:36 +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 30A3UawS006759 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Jan 2023 03:30:36 GMT Received: from [10.110.115.72] (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.36; Mon, 9 Jan 2023 19:30:35 -0800 Message-ID: Date: Mon, 9 Jan 2023 19:30:34 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [Freedreno] [PATCH v3] drm/msm/dsi: Add missing check for alloc_ordered_workqueue Content-Language: en-US To: Jiasheng Jiang , , CC: , , , , , , , , , , , , References: <20230110021651.12770-1-jiasheng@iscas.ac.cn> From: Abhinav Kumar In-Reply-To: <20230110021651.12770-1-jiasheng@iscas.ac.cn> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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: PSQcSj4cwEIykNNT9_AiPEwmDSZJnxtQ X-Proofpoint-GUID: PSQcSj4cwEIykNNT9_AiPEwmDSZJnxtQ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-09_16,2023-01-09_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 lowpriorityscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 adultscore=0 spamscore=0 impostorscore=0 clxscore=1011 priorityscore=1501 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301100020 X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no 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 On 1/9/2023 6:16 PM, Jiasheng Jiang wrote: > Add check for the return value of alloc_ordered_workqueue as it may return > NULL pointer and cause NULL pointer dereference. > > Signed-off-by: Jiasheng Jiang Reviewed-by: Abhinav Kumar > --- > Changelog: > > v2 -> v3: > > 1. Simply return -ENOMEM instead of using ret. > 2. No change of the "goto fail". > > v1 -> v2: > > 1. Change the "goto fail" into "return ret" and drop the "fail" label. > --- > drivers/gpu/drm/msm/dsi/dsi_host.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c > index 89aadd3b3202..f167a45f1fbd 100644 > --- a/drivers/gpu/drm/msm/dsi/dsi_host.c > +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c > @@ -1977,6 +1977,9 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi) > > /* setup workqueue */ > msm_host->workqueue = alloc_ordered_workqueue("dsi_drm_work", 0); > + if (!msm_host->workqueue) > + return -ENOMEM; > + > INIT_WORK(&msm_host->err_work, dsi_err_worker); > > msm_dsi->id = msm_host->id;