<style>table.customTableClassName {margin-bottom: 10px;border-collapse: collapse;display: table;}.customTableClassName td, .customTableClassName th {border: 1px solid #ddd;}</style><p style="margin:0px;">I find null pointer bug when I debug the kernel of loongson,I think the function fb_set_suspend() add pointer judgment will more friendly.<br><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><div id="write-custom-companySignature"><p style="color: rgb(0, 0, 0); font-family: tahoma, arial, helvetica, sans-serif; font-size: 12px; background: rgb(254, 254, 254);"><strong><span style="font-size:13.5pt">统信软件技术有限公司</span></strong><span lang="EN-US"> <o:p></o:p></span></p><p style="color: rgb(0, 0, 0); font-family: tahoma, arial, helvetica, sans-serif; font-size: 12px; background: rgb(254, 254, 254);"><strong><span lang="EN-US" style="font-size:7.5pt">UnionTech Software Technology Co., Ltd. </span></strong><span style="font-size: 10pt;"> </span></p><p style="color: rgb(0, 0, 0); font-family: tahoma, arial, helvetica, sans-serif; font-size: 12px; background: rgb(254, 254, 254);"><span style="background-color: rgb(255, 255, 255); font-size: 10pt;">官网:</span><span lang="EN-US" style="background-color: rgb(255, 255, 255); font-size: 10pt; font-family: Tahoma, sans-serif;">www.uniontech.com</span><span style="font-size: 9pt; background-color: rgb(255, 255, 255);">  </span></p><p style="color: rgb(0, 0, 0); font-family: tahoma, arial, helvetica, sans-serif; font-size: 12px; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"><br></p><div style=""><span style="font-family:tahoma, arial, helvetica, sans-serif"><span style="font-size: 12px;">此电子邮件消息仅供预期收件人使用,其中可能包含保密或特权使用信息。如果您不是预期收件人,请勿使用、传播、分发或复制此电子邮件或信赖此邮件采取任何行动。如果您误收了此邮件,请立即回复邮件通知统信软件技术有限公司发件人,并删除误收电子邮件及其相关附件。感谢配合!</span></span>
  </div><div style=""><span style="font-family:tahoma, arial, helvetica, sans-serif"><span style="font-size: 12px;"><br></span></span>
  </div><div style=""><span style="font-family:tahoma, arial, helvetica, sans-serif"><span style="font-size: 12px;">This email message is intended only for the use of the individual or entity who/which is the intended recipient and may contain information that is privileged or confidential. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution or copying of, or taking any action in reliance on, this e-mail is strictly prohibited. If you have received this email in error, please notify UnionTech Software Technology  immediately by replying to this e-mail and immediately delete and discard all copies of the e-mail and the attachment thereto (if any). Thank you.</span></span>
  </div><br>
  </div><p style="margin:0px;"><br>
  </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>