<style>table.customTableClassName {margin-bottom: 10px;border-collapse: collapse;display: table;}.customTableClassName td, .customTableClassName th {border: 1px solid #ddd;}</style><div id="write-custom-write" tabindex="0" style="font-size: 14px; font-family: 宋体; outline: none;"><p style="margin:0px;"><br><span style="font-family: verdana, Tahoma, Arial, 宋体, sans-serif; font-size: 16px;">I find null pointer bug when I debug the kernel of loongson in mips,I think the function fb_set_suspend() adding pointer judgment will more friendly.</span><br></p></div><p style="margin:0px;"><br></p><p style="margin:0px;">[  101.409101] PM: hibernation entry               </p><p style="margin:0px;">[  101.526365] PM: Syncing filesystems ... </p><p style="margin:0px;">[  101.543008] PM: done.</p><p style="margin:0px;">[  101.545287] Freezing user space processes ... (elapsed 0.001 seconds) done.</p><p style="margin:0px;">[  101.553722] OOM killer disabled.</p><p style="margin:0px;">[  101.556988] PM: Preallocating image memory... done (allocated 79819 pages)</p><p style="margin:0px;">[  101.709595] PM: Allocated 1277104 kbytes in 0.14 seconds (9122.17 MB/s)</p><p style="margin:0px;">[  101.716179] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.</p><p style="margin:0px;">[  101.761338] CPU 1 Unable to handle kernel paging request at virtual address 00000000000003e0, epc == ffffffff81068e10, ra == ffffffff81068e0c<br></p><p style="margin:0px;">[  101.777602] Oops[#1]:</p><p style="margin:0px;">[  101.779858] CPU: 1 PID: 1099 Comm: kworker/u8:6 Tainted: G        W         4.19.0-loongson-3-desktop #43</p><p style="margin:0px;">[  101.789368] Hardware name: Dahua DH-HDC5000L/M2001, BIOS L4J74B006DHT0318 V4.0 03/18/2021 16:44:33</p><p style="margin:0px;">[  101.798282] Workqueue: events_unbound async_run_entry_fn</p><p style="margin:0px;">[  101.803557] \$ 0   : 0000000000000000 0000000000000001 0000000000000001 0000000000000000</p><p style="margin:0px;">[  101.811513] \$ 4   : ffffffff822426f0 0000000000000001 980000000754b510 0000000000000000</p><p style="margin:0px;">[  101.819468] \$ 8   : 000000000000031d 202c796669746f6e 31202c796669746f ffffffff82220000</p><p style="margin:0px;">[  101.827423] \$12   : 0000000000000001 ffffffff8244ba15 ffffffffffffffff 0000000000000030</p><p style="margin:0px;">[  101.835378] \$16   : 0000000000000000 ffffffff8038bd40 ffffffffc0070000 0000000000000001</p><p style="margin:0px;">[  101.843333] \$20   : ffffffffc006cbc0 980000025d84b040 980000025516f2e0 980000025516f300</p><p style="margin:0px;">[  101.851288] \$24   : 0000000000000000 ffffffff811fd880                                  </p><p style="margin:0px;">[  101.859244] \$28   : 980000025d07c000 980000025d07fc40 ffffffffc0070000 ffffffff81068e0c</p><p style="margin:0px;">[  101.867199] Hi    : 0000000000b807f2</p><p style="margin:0px;">[  101.870746] Lo    : f1a9fbe76d65cd06</p><p style="margin:0px;">[  101.874298] epc   : ffffffff81068e10 fb_set_suspend+0x50/0x80</p><p style="margin:0px;">[  101.880006] ra    : ffffffff81068e0c fb_set_suspend+0x4c/0x80</p><p style="margin:0px;">[  101.885712] Status: 5400cce3 KX SX UX KERNEL EXL IE </p><p style="margin:0px;">[  101.890645] Cause : 1080000c (ExcCode 03)</p><p style="margin:0px;">[  101.894623] BadVA : 00000000000003e0</p><p style="margin:0px;">[  101.898170] PrId  : 0014c004 (ICT Loongson-3)</p><p style="margin:0px;">[  101.902494] Modules linked in: fuse bluetooth ecdh_generic sha256_generic cfg80211 rfkill vfat fat serio_raw uio_pdrv_genirq binfmt_misc ip_td</p><p style="margin:0px;">[  101.918414] Process kworker/u8:6 (pid: 1099, threadinfo=00000000b0273bba, task=00000000b7551ec1, tls=0000000000000000)</p><p style="margin:0px;">[  101.929045] Stack : 0000000000000000 6c635f7473696c5f 980000025516f308 ffffffffc0061aa0</p><p style="margin:0px;">[  101.937001]         ffffffffc0070000 ffffffffc006d7c0 ffffffffc006ce00 0000000000000000</p><p style="margin:0px;">[  101.944955]         980000025c056098 ffffffffc0070238 ffffffff83490000 0000000000000001</p><p style="margin:0px;">[  101.952910]         980000025c0560f8 0000000000000000 ffffffff82218830 ffffffff82290000</p><p style="margin:0px;">[  101.960865]         980000025cfb8480 ffffffffc0061c58 0000000000000001 ffffffff81008fd4</p><p style="margin:0px;">[  101.968819]         980000025c056098 980000025c056220 0000000000000000 ffffffff81008f40</p><p style="margin:0px;">[  101.976774]         0000000000000000 ffffffff815377e0 980000025c0560f8 980000025c056098</p><p style="margin:0px;">[  101.984729]         0000000000000000 ffffffff81539608 ffffffff82218830 980000025c056098</p><p style="margin:0px;">[  101.992684]         ffffffff83490000 ffffffff82370000 980000025c018000 980000025c01c000</p><p style="margin:0px;">[  102.000638]         0000000000000000 ffffffff81539aac 980000025d07fd68 98000001cacd0fa0</p><p style="margin:0px;">[  102.008593]         ...</p><p style="margin:0px;">[  102.011018] Call Trace:</p><p style="margin:0px;">[  102.013443] [<ffffffff81068e10>] fb_set_suspend+0x50/0x80</p><p style="margin:0px;">[  102.018819] [<ffffffffc0061aa0>] loongson_drm_suspend+0x1a0/0x340 [loongson]</p><p style="margin:0px;">[  102.025827] [<ffffffffc0061c58>] loongson_pmops_freeze+0x18/0x40 [loongson]</p><p style="margin:0px;">[  102.032748] [<ffffffff81008fd4>] pci_pm_freeze+0x94/0x240</p><p style="margin:0px;">[  102.038114] [<ffffffff815377e0>] dpm_run_callback.isra.5+0x20/0x140</p><p style="margin:0px;">[  102.044341] [<ffffffff81539608>] __device_suspend+0x2c8/0x740</p><p style="margin:0px;">[  102.050049] [<ffffffff81539aac>] async_suspend+0x2c/0x1c0</p><p style="margin:0px;">[  102.055411] [<ffffffff803157cc>] async_run_entry_fn+0x8c/0x280</p><p style="margin:0px;">[  102.061207] [<ffffffff802fea3c>] process_one_work+0x43c/0x980</p><p style="margin:0px;">[  102.066915] [<ffffffff802ff2a4>] worker_thread+0x324/0xc00</p><p style="margin:0px;">[  102.072364] [<ffffffff8030cde0>] kthread+0x1e0/0x200</p><p style="margin:0px;">[  102.077296] [<ffffffff80220688>] ret_from_kernel_thread+0x14/0x1c</p><p style="margin:0px;">[  102.083350] Code: 0c41a0a0  24040002  24020001 <ae0203e0> dfbf0018  dfb00010  03e00008  67bd0020  00000000 </p><p style="margin:0px;">[  102.093038] </p><p style="margin:0px;">[  102.094531] ---[ end trace 3ed8a43fa8cf3077 ]---</p><p style="margin:0px;"><br></p><p style="margin:0px;"> </p><div style="padding:5px;padding-left:0px;border-top:solid #999 1.0pt;font-family: arial; font-size:12px;margin-bottom:20px;"><p style="margin:0px;"><strong>From:</strong> "Matthew Wilcox <willy@infradead.org>"</p><p style="margin:0px;"><strong>To:</strong> "songqiang <songqiang@uniontech.com>"</p><p style="margin:0px;"><strong>CC:</strong> "sam <sam@ravnborg.org>","b.zolnierkie <b.zolnierkie@samsung.com>","penguin-kernel <penguin-kernel@i-love.sakura.ne.jp>","george.kennedy <george.kennedy@oracle.com>","arnd <arnd@arndb.de>","tzimmermann <tzimmermann@suse.de>","jgg <jgg@ziepe.ca>","dri-devel <dri-devel@lists.freedesktop.org>","linux-fbdev <linux-fbdev@vger.kernel.org>","linux-kernel <linux-kernel@vger.kernel.org>"</p><p style="margin:0px;"><strong>Sent:</strong> 2021-05-19 20:16</p><p style="margin:0px;"><strong>Subject:</strong> Re: [PATCH] drivers/video/fbdev/core/fbmem.c: add pointer judgment</p></div><p style="margin:0px;">On Wed, May 19, 2021 at 08:00:28PM +0800, songqiang wrote:  <br>> Signed-off-by: songqiang <songqiang@uniontech.com>  <br>> ---  <br>  <br>You need to explain:  <br>  <br> - Why you think this patch is needed  <br> - Did you observe a problem at runtime?  <br> - Is this the output from some checking tool?  <br> - Why this is the right way to address the problem  <br>  <br>  <br>  <br>  <br> </p>