From patchwork Mon Mar 6 10:07:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 64568 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1760860wrd; Mon, 6 Mar 2023 02:25:59 -0800 (PST) X-Google-Smtp-Source: AK7set/vKL92frCgXIVQdektSdmxQspQwi8Dt28FOiASHF4R5n2l766MmWNoYsvMjR20b/sopIw8 X-Received: by 2002:a17:907:5014:b0:88d:ba89:184b with SMTP id fw20-20020a170907501400b0088dba89184bmr10503390ejc.28.1678098358861; Mon, 06 Mar 2023 02:25:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678098358; cv=none; d=google.com; s=arc-20160816; b=N4hGziAD51KL4W3CGO4n16x0jw8ZMYha6/eWu5uNSpSEB/2Uias+AvsDaQYOvVZKBr roQtAyNjWwASB8mY+jAFEyy97kRpHbUFAhrGfPoVpUwxzbEUnTRWZr/1Fd9MR5Bw5iZk I/8xbmLjWco1eCtNxd6OZ1qS65Y3FTdHuMapECz5JCJL3tOAfZR3UK8Xlsxx0GqYBfeO fGLVujbF4x9gFfrEhJWI41Ia4Yok14JdB+jgHoI5+Jh5V7o0pqlLJMUOclrXTenflFln 9rfTDJDMH6RyMZ75sjyGdSYGX0LflJIRkKKFfDntI1uvaaHvfzEItChw6TkWWC0NjAWE bjjQ== 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=ooZEPWexaDwYOGw4H6LyG7aAaeKdV3cp+5VnxIiCJio=; b=H/A/5F0wxZU5pw7GAO07YuCcDWXEuE+lwGfoE3T3wDOzpKeTf221gmOSvsMmfldXWO UO4yku4hqdVcU4x9I2U0jh0JwQIr2LWGFmGsJqpua+dDGhihNPvi1bdcPh3lamFGyz2c ZNfz7uQK6BPrApzIguVsV+1GLB2xqvLqzCQf3WMvL7vzzNjXCmq7+qJi1YtQs3RBuAZo MgS6IYQ2CMepb9oJucM6N6AN7BTinbf140LTKg982ED+ak2IKe1KC0NGaiKLXcPvFbs+ QlBIgVGCIfvZYs6EkwvhnbJyCUGroNAg9QwEc/Mu/UDk9qvX4uS+bSa/hdj58FjOv9o0 7GBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XmLuhUwN; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d16-20020a056402079000b004c5248cbebfsi9351294edy.101.2023.03.06.02.25.22; Mon, 06 Mar 2023 02:25:58 -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=@kernel.org header.s=k20201202 header.b=XmLuhUwN; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230373AbjCFKJj (ORCPT + 99 others); Mon, 6 Mar 2023 05:09:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230287AbjCFKJX (ORCPT ); Mon, 6 Mar 2023 05:09:23 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43B34222E0; Mon, 6 Mar 2023 02:09:20 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id CE32460CF7; Mon, 6 Mar 2023 10:09:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C06C2C433A8; Mon, 6 Mar 2023 10:09:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678097358; bh=5WWc/IA6KEuvk5qRgQkziyYcmpqaQV99Q299DA5bkuM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XmLuhUwNoWU4IVC3iCrUwuhv3eh0i+kq4h5bW1w33pSFpe+CwK2HxoWKZsKTByNBf 6yzugc3HGaFj9ddQ/D8SdZPYuyGO/747QGtagRaWE15638eUSXetb085HvdJ0tb0yD k9d59zOGwVE4RqTl7E/wLxO/u8ETt3gibWI5EZEMPxl87z9qhmqYQhRWoA4wc5mfdE Gv+F6VLJAZF1brS+mhjVTpfD0+/8ZFNkL1Wu/rtA6BWzzole3ogicanzUKDc6evCDS uAEGNwIz8xUAj8quEXrn4ZKxOwK7LJnsIiUt9LWN9jh4b+def2ILb+fso6oGj75De0 rxU1+j1HjZ8yQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1pZ7n5-0007Qq-HN; Mon, 06 Mar 2023 11:09:59 +0100 From: Johan Hovold To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov Cc: Sean Paul , David Airlie , Daniel Vetter , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH 07/10] drm/msm: fix missing wq allocation error handling Date: Mon, 6 Mar 2023 11:07:19 +0100 Message-Id: <20230306100722.28485-8-johan+linaro@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230306100722.28485-1-johan+linaro@kernel.org> References: <20230306100722.28485-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 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?1759613664987790007?= X-GMAIL-MSGID: =?utf-8?q?1759613664987790007?= Add the missing sanity check to handle workqueue allocation failures. Fixes: c8afe684c95c ("drm/msm: basic KMS driver for snapdragon") Cc: stable@vger.kernel.org # 3.12 Cc: Rob Clark Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_drv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 41cc6cd690cd..ac3b77dbfacc 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -432,6 +432,10 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv) priv->dev = ddev; priv->wq = alloc_ordered_workqueue("msm", 0); + if (!priv->wq) { + ret = -ENOMEM; + goto err_put_dev; + } INIT_LIST_HEAD(&priv->objects); mutex_init(&priv->obj_lock);