<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:DengXian;}
.MsoChpDefault
{mso-style-type:export-only;}
/* Page Definitions */
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang=ZH-CN><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Simply complain if the combined result of start_page and num_pages goes over</span></p><p class=MsoNormal><span lang=EN-US>the pages bo has. Let me know if the added warning is too heavy a hammer.</span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Cc: Christian Koenig <christian.koenig@amd.com></span></p><p class=MsoNormal><span lang=EN-US>Cc: Huang Rui <ray.huang@amd.com></span></p><p class=MsoNormal><span lang=EN-US>Cc: Junwei Zhang <Jerry.Zhang@amd.com></span></p><p class=MsoNormal><span lang=EN-US>Signed-off-by: Hillf Danton <hdanton@sina.com></span></p><p class=MsoNormal><span lang=EN-US>---</span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>--- a/drivers/gpu/drm/ttm/ttm_bo_util.c 2019-04-02 09:27:24.521761100 +0800</span></p><p class=MsoNormal><span lang=EN-US>+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c 2019-04-02 09:37:52.108898500 +0800</span></p><p class=MsoNormal><span lang=EN-US>@@ -631,6 +631,8 @@ int ttm_bo_kmap(struct ttm_buffer_object</span></p><p class=MsoNormal><span lang=EN-US> return -EINVAL;</span></p><p class=MsoNormal><span lang=EN-US> if (start_page > bo->num_pages)</span></p><p class=MsoNormal><span lang=EN-US> return -EINVAL;</span></p><p class=MsoNormal><span lang=EN-US>+ if (WARN_ON(start_page > bo->num_pages - num_pages))</span></p><p class=MsoNormal><span lang=EN-US>+ return -EINVAL;</span></p><p class=MsoNormal><span lang=EN-US> </span></p><p class=MsoNormal><span lang=EN-US> (void) ttm_mem_io_lock(man, false);</span></p><p class=MsoNormal><span lang=EN-US> ret = ttm_mem_io_reserve(bo->bdev, &bo->mem);</span></p><p class=MsoNormal><span lang=EN-US>--</span><span lang=EN-US style='font-size:12.0pt'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>