From patchwork Wed Nov 24 20:14:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Noralf_Tr=C3=B8nnes?= X-Patchwork-Id: 12637707 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 00AE3C433EF for ; Wed, 24 Nov 2021 20:15:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BD2CC6EA01; Wed, 24 Nov 2021 20:15:42 +0000 (UTC) Received: from asav22.altibox.net (asav22.altibox.net [109.247.116.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id D0CC96E9FF for ; Wed, 24 Nov 2021 20:15:41 +0000 (UTC) Received: from localhost.localdomain (211.81-166-168.customer.lyse.net [81.166.168.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: noralf.tronnes@ebnett.no) by asav22.altibox.net (Postfix) with ESMTPSA id E5851221A6; Wed, 24 Nov 2021 21:15:35 +0100 (CET) From: =?utf-8?q?Noralf_Tr=C3=B8nnes?= To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/gud: Fix descriptor magic check Date: Wed, 24 Nov 2021 21:14:38 +0100 Message-Id: <20211124201438.27562-1-noralf@tronnes.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=aqWc9xRV c=1 sm=1 tr=0 a=OYZzhG0JTxDrWp/F2OJbnw==:117 a=OYZzhG0JTxDrWp/F2OJbnw==:17 a=IkcTkHD0fZMA:10 a=M51BFTxLslgA:10 a=QyXUC8HyAAAA:8 a=SJz97ENfAAAA:8 a=nxsdTljpGUYjP67ldvAA:9 a=QEXdDO2ut3YA:10 a=vFet0B0WnEQeilDPIY6i:22 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Noralf_Tr=C3=B8nnes?= , peter@stuge.se, kernel test robot Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" le32_to_cpu() was put around the wrong operand in the descriptor magic value check. Fix this and put it around the descriptor value which is the one that is in little endian format. Fixes: 40e1a70 ("drm: Add GUD USB Display driver") Reported-by: kernel test robot Signed-off-by: Noralf Trønnes --- drivers/gpu/drm/gud/gud_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/gud/gud_drv.c b/drivers/gpu/drm/gud/gud_drv.c index 3f9d4b9a1e3d..e6db478f1e49 100644 --- a/drivers/gpu/drm/gud/gud_drv.c +++ b/drivers/gpu/drm/gud/gud_drv.c @@ -92,7 +92,7 @@ static int gud_get_display_descriptor(struct usb_interface *intf, if (ret != sizeof(*desc)) return -EIO; - if (desc->magic != le32_to_cpu(GUD_DISPLAY_MAGIC)) + if (le32_to_cpu(desc->magic) != GUD_DISPLAY_MAGIC) return -ENODATA; DRM_DEV_DEBUG_DRIVER(&intf->dev,