Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3121037rwb; Mon, 15 Aug 2022 18:38:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR61+rTqFrDm921GdRbEKGFLMqPWM/tiZgmKYRPT+2S1IPpshYxIgCApUbDd1Pa/HGU5MLsh X-Received: by 2002:a17:907:97cd:b0:731:5d0:4434 with SMTP id js13-20020a17090797cd00b0073105d04434mr11117250ejc.603.1660613889862; Mon, 15 Aug 2022 18:38:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660613889; cv=none; d=google.com; s=arc-20160816; b=ckiIbO/W25CBo4NyFEgwyg3QEHDEQr4nwwDbW7J50yGsDnnnBNclOpAVnIxRxxe35X h0XSgl0zrftaHtfcEkmMGTwa9RyWH14Sn4fb4r5iqg06C1JAYh9TtSOQYPAK8DU6UDw1 7b6v3DpRuBDZmTBpP1F6hcwJ/aVI3E5A6XmGys8tgqAYihQktYcnTJsi33PvY6ClZsLy xOy2VpzHSTzFw0cgcRCHmWKcnYskqHgxkVLcB+ly0r7xwXxRcXpvfP/34c+fxQlQbg2F 8ZEXVqASC0HFGYskLYwGoNFKuiMfn4Zu6rRHfEUN6DpVa7l0Z9hKFWWDZ2+hDMXABQSM TDkg== 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=BSOpjprvByNwbuPQHkifmRdUueKpUyM9Ftuh0hpse2CWXFutIEQQWspteaKtRLRtlD GSklyIcr2E1CjgUNFY88riDcItfSDK52l2R0fl9FMJoThmI72MYa2M2IBAl9Qkrsjru5 95tUqmPj1lGtZ0RfwlNaDR9RjmgK3pe6XcGC+oKiTlC0y4ZJmdmtTWQWU0vObicKgJcr NRJa5roNBTZ8wvW6pv6pFvC6VNLRJ6MYUf18TXSi9gxggVjzH77+JOTVuOaVuhmZKKrl U1+cZVpcs7ahhi45tvAGTkYjWd2lYyQnklD3RD6BhqY6cUd0oE4AOT56+GxbKLE6pbyZ xSyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sYf26RQI; 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 q10-20020a056402518a00b0043bd77de21esi10107246edd.51.2022.08.15.18.37.45; Mon, 15 Aug 2022 18:38:09 -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=sYf26RQI; 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 S1353577AbiHOXcC (ORCPT + 99 others); Mon, 15 Aug 2022 19:32:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343925AbiHOX0K (ORCPT ); Mon, 15 Aug 2022 19:26:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91561474D4; Mon, 15 Aug 2022 13:06:21 -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 2D2D760025; Mon, 15 Aug 2022 20:06:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2041CC433C1; Mon, 15 Aug 2022 20:06:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593980; bh=FU27mNks8W5srJ5JvNYi5+dQrXnSsKiy73X4z1VGlp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sYf26RQI3lCEMsbeutyGd8QSEn9KF8SaTnQ+wlmNa6fFoEHe7bx18881GYO9rdRve smY6iR2jS0GGYIETkz6wN2Tc4VKmj/qgx68K/fr3JcAE0q9GlnB8niOJVKo73QKnUo sxD5A1jCTGHiinEiIQcQ8Hc9YEZXcjAQ3cjFyRqI= 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.19 0357/1157] drm/vkms: check plane_composer->map[0] before using it Date: Mon, 15 Aug 2022 19:55:13 +0200 Message-Id: <20220815180453.997054498@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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