Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp605071iob; Wed, 4 May 2022 04:17:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXlS+FnHaXhOfSScVKZqsx3wEmXkRoaPGurg3FFEfhpQ/xvN4gMqgGG+s0A7SQKsnIgmy4 X-Received: by 2002:a17:907:970a:b0:6f4:5ad2:5e66 with SMTP id jg10-20020a170907970a00b006f45ad25e66mr11736572ejc.698.1651663047371; Wed, 04 May 2022 04:17:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651663047; cv=none; d=google.com; s=arc-20160816; b=PZ19HPUNdB/+67UEApGegEzUQ/JH74y+XnslT8jXJXY4bUyqquMZOIISinBQxskaL1 2wMyCpo7a72GeMfaDuVFCfCsObvblQmNfISFptH9osSy21W08R8mIkfVDCQ4KSuk9WZM 0jul+XYLA93q26i+pdfLatONZOTgw3ylpzokmFQzDvdj+ePyWdoh68/Ekv8WIJEK3c2b qhiH3ewdipG27o9WUQOFy81wdmvXmi2X0U6io3l4PFjDxVBPN7PA9sWP5Lr3+Zrbja0N E9M/YVcKeqZDRfdA8IlR0VJhymXufiURKcLfuf4srec0/+7gZK5r8FbKhv3mX+FDRnve 8u1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=vWFF6VGjD4uKJEIXD4qhyxLIgBRXSjglad3oRA7XxNM=; b=hiK/RmF+zX6xkWOJemRmfakxzQoA5BsYBGPsVBUEIOtD539BJkRLD3qy3v+FOCFndz MzMagYukJXkrmAHVuslHVw2suGVJJ8h2nmnDwtVsWQp1b7l9HS7cR66fXPRMwANNxcmR 9b/D97B1fXP15zKDIpQXzFH/12hz+EE+F1Nq0d7TKt9UWAoyBDQITPjOjtontd71k5aV +tgxyBN45d2nLqE+gPh9WDMQehZXXZ1QlVhw9qQ9xEJBVuthINXqSI/HUelzE53GHn65 CFFkUkmqnWNsKNoLkr6tdVmv3Fh45cJYGs+jb7zDsfTPMgDMCgixS8A2KI4tiVodEgLE yoNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ravnborg.org header.s=rsa1 header.b=e8xdyj4P; dkim=neutral (no key) header.i=@ravnborg.org; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga37-20020a1709070c2500b006f3e77d98b6si6784889ejc.174.2022.05.04.04.17.02; Wed, 04 May 2022 04:17:27 -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=@ravnborg.org header.s=rsa1 header.b=e8xdyj4P; dkim=neutral (no key) header.i=@ravnborg.org; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236204AbiECU5f (ORCPT + 99 others); Tue, 3 May 2022 16:57:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236953AbiECU5e (ORCPT ); Tue, 3 May 2022 16:57:34 -0400 Received: from mailrelay4-1.pub.mailoutpod1-cph3.one.com (mailrelay4-1.pub.mailoutpod1-cph3.one.com [46.30.210.185]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2D5533A3B for ; Tue, 3 May 2022 13:53:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ravnborg.org; s=rsa1; h=in-reply-to:content-type:mime-version:references:message-id:subject:cc:to: from:date:from; bh=vWFF6VGjD4uKJEIXD4qhyxLIgBRXSjglad3oRA7XxNM=; b=e8xdyj4Pjc/xbIQ0jd1XLsTmI1SxBeFC6zysAQkQQyGwmQgRcYC1fGfgOhFS/cWZh5FSZbARm6iaW Rr4R6ZaMyZzhFTUmwhi5Ojte9JYY8DjtW2hwxnV/O3bQ9W5edKdz8k9asJtuctHijyfEetGB4MNJyA na7c8LnkIfcLi864fW7nkz7sLSPnAeBYl+xcJ1DOg67SOwWnP9S1efNq14k2E3678RLII6J/+DxEOd G9TxhzEu9xZKC2ck+epBZlKZnMKN15N5id5ghn++DnnTALcXJ+y03Z605WQ5bjaQDkJuZEF+epxNOz Ch69eiAtS+TSC3c0z4PI2aHq9whY1pg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ravnborg.org; s=ed1; h=in-reply-to:content-type:mime-version:references:message-id:subject:cc:to: from:date:from; bh=vWFF6VGjD4uKJEIXD4qhyxLIgBRXSjglad3oRA7XxNM=; b=5KUFBF8tLRwJaNS5dUr0ofjHsCmMwJsIBey39OnQe/9UL1PeaZRy5U+WWa/zjEyhB8gsGFvPsO+VB m42kiymCw== X-HalOne-Cookie: 3ad8b22d728e1f30d497971a1001bc6e70176112 X-HalOne-ID: 2655276f-cb23-11ec-8229-d0431ea8bb10 Received: from mailproxy4.cst.dirpod3-cph3.one.com (80-162-45-141-cable.dk.customer.tdc.net [80.162.45.141]) by mailrelay4.pub.mailoutpod1-cph3.one.com (Halon) with ESMTPSA id 2655276f-cb23-11ec-8229-d0431ea8bb10; Tue, 03 May 2022 20:53:57 +0000 (UTC) Date: Tue, 3 May 2022 22:53:55 +0200 From: Sam Ravnborg To: Javier Martinez Canillas Cc: linux-kernel@vger.kernel.org, Maxime Ripard , Thomas Zimmermann , Junxiao Chang , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Subject: Re: [PATCH v2] fbdev: Use helper to get fb_info in all file operations Message-ID: References: <20220503201934.681276-1-javierm@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220503201934.681276-1-javierm@redhat.com> X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLACK 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 Tue, May 03, 2022 at 10:19:34PM +0200, Javier Martinez Canillas wrote: > A reference to the framebuffer device struct fb_info is stored in the file > private data, but this reference could no longer be valid and must not be > accessed directly. Instead, the file_fb_info() accessor function must be > used since it does sanity checking to make sure that the fb_info is valid. > > This can happen for example if the registered framebuffer device is for a > driver that just uses a framebuffer provided by the system firmware. In > that case, the fbdev core would unregister the framebuffer device when a > real video driver is probed and ask to remove conflicting framebuffers. > > Most fbdev file operations already use the helper to get the fb_info but > get_fb_unmapped_area() and fb_deferred_io_fsync() don't. Fix those two. > > Since fb_deferred_io_fsync() is not in fbmem.o, the helper has to be > exported. Rename it and add a fb_ prefix to denote that is public now. > > Reported-by: Junxiao Chang > Signed-off-by: Javier Martinez Canillas Acked-by: Sam Ravnborg