Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2930215rwb; Mon, 15 Aug 2022 14:16:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Kv6kaIgkZDmfle2Tk+7DUaVTAMyXDaeobfnEjn2MMn6k3sFj3ZUIsRs3xg9aXUh0DiOld X-Received: by 2002:a17:903:1cd:b0:16e:e519:c6f6 with SMTP id e13-20020a17090301cd00b0016ee519c6f6mr18410170plh.116.1660598055206; Mon, 15 Aug 2022 14:14:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660598055; cv=none; d=google.com; s=arc-20160816; b=yBoR39uJ9dg3mWfoAcbOYzQxm+14qKdRqi1XiKqGStkQSI6L61nB8tsIs0mn64fTbE 6HcAQPmL39GEBaXP/803Mm55PQR/I11SPVuwc0xBJfsxrjxQD3jWcjtLTxKdpFLUtG9Z pEJN5IqLxgqJG1EiBKwoDPbpQ3G2vBhKJkOPP0z4Drzt9HhnIa+2jk3tQx4wOFeujWiy OMDWcdP1I94Zu1p2C7GjYhzzR57YLP9JtzHr7gnSh5BGn9/l/a5PaVpvzE38m9VBfAxb /Q20bSyVu45Lwonpgx58VOfSUEdq/btDG1/Sy9jifEeRaTKauFXzxUZg2gNUhugeEuAH j2kQ== 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=UJFTbWVpnhebwJV7IXh/4Bo4VLEYktdgj8UyQ6dRVEA=; b=E71arRcGHE/E0FN00JEKuINQL5Zd85pEkTuU2VzPVwhbr5n9GHaTMWlj3xOvGvdbVA 1LQm8T4H7cLnSadK+Y81e/lF+s3Sc2OOcJQwV9JUj/tICrYi7np7f2agQ3NzcXZUQ8yx mhq1b83cWGalz37a1M27d2FtjEKxKl6NKf18VlCqyk/XUcbhrj9q/G5gUykbgy3Rbo0Z 76qNUCBMdgn+zSgz0feiCN+xm0cNzGdv4ymYXDiJo3IvxrCXobCVdT94tOIJblCoPRUH 5h3W0pGnQB4T0s9eXwswOpEO+mq05V7B6avVOOrHIYspFAjJcLOWxj8KUuh5InBVdyOo zbOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iNCqtNY7; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d1-20020a636801000000b0041bc27c45besi11764095pgc.615.2022.08.15.14.14.02; Mon, 15 Aug 2022 14:14:15 -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=iNCqtNY7; 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 S244133AbiHOVCh (ORCPT + 99 others); Mon, 15 Aug 2022 17:02:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240957AbiHOVAI (ORCPT ); Mon, 15 Aug 2022 17:00:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA83250704; Mon, 15 Aug 2022 12:12:58 -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 dfw.source.kernel.org (Postfix) with ESMTPS id CBDF560EDA; Mon, 15 Aug 2022 19:12:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAD60C433D6; Mon, 15 Aug 2022 19:12:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590777; bh=FU27mNks8W5srJ5JvNYi5+dQrXnSsKiy73X4z1VGlp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iNCqtNY7+f9WWtDbZK0mfu1MQZnDGNmGe0q0Gc57ygT6Ucv+g4yMQ1VVsD7NKLxxJ vtnBwKN6Ux6FIOHplAG30jMzwW2jfamoBxvAh7BDEvvsnksuIsQdoNySS2w0ZNehhw l0vQciFnO7h7YCVCm404yzOaINb/0jLiJOonUjns= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Andr=C3=A9=20Almeida?= , Tales Lelo da Aparecida , Melissa Wen , Sasha Levin Subject: [PATCH 5.18 0337/1095] drm/vkms: check plane_composer->map[0] before using it Date: Mon, 15 Aug 2022 19:55:36 +0200 Message-Id: <20220815180443.743885616@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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,T_SCC_BODY_TEXT_LINE 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 From: Tales Lelo da Aparecida [ Upstream commit 24f6fe3226c6f9f1b8406311a96b59c6e650b707 ] Fix a copypasta error. The caller of compose_plane() already checks primary_composer->map. In contrast, plane_composer->map is never verified here before handling. Fixes: 7938f4218168 ("dma-buf-map: Rename to iosys-map") Reviewed-by: André Almeida Signed-off-by: Tales Lelo da Aparecida Signed-off-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/20220415111300.61013-2-tales.aparecida@gmail.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/vkms/vkms_composer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/drivers/gpu/drm/vkms/vkms_composer.c index c6a1036bf2ea..b47ac170108c 100644 --- a/drivers/gpu/drm/vkms/vkms_composer.c +++ b/drivers/gpu/drm/vkms/vkms_composer.c @@ -157,7 +157,7 @@ static void compose_plane(struct vkms_composer *primary_composer, void *vaddr; void (*pixel_blend)(const u8 *p_src, u8 *p_dst); - if (WARN_ON(iosys_map_is_null(&primary_composer->map[0]))) + if (WARN_ON(iosys_map_is_null(&plane_composer->map[0]))) return; vaddr = plane_composer->map[0].vaddr; -- 2.35.1