[PATCH 3.7-rc8] ttm: Fix possible _manager memory allocation oops

2012-12-07 Thread Dave Airlie
On Fri, Dec 7, 2012 at 9:05 AM, Tim Gardner wrote: > On 12/06/2012 03:46 PM, Dave Airlie wrote: > >>> >>> ttm_page_pool_init_locked(&_manager->wc_pool, GFP_HIGHUSER, >>> "wc"); >>> >>> @@ -817,6 +821,7 @@ int ttm_page_alloc_init(struct ttm_mem_global *glob, >>> unsigned max_pages) >>>

Re: [PATCH 3.7-rc8] ttm: Fix possible _manager memory allocation oops

2012-12-07 Thread Tim Gardner
On 12/06/2012 03:46 PM, Dave Airlie wrote: ttm_page_pool_init_locked(&_manager->wc_pool, GFP_HIGHUSER, "wc"); @@ -817,6 +821,7 @@ int ttm_page_alloc_init(struct ttm_mem_global *glob, unsigned max_pages) &glob->kobj, "pool"); if (unlikely(r

Re: [PATCH 3.7-rc8] ttm: Fix possible _manager memory allocation oops

2012-12-06 Thread Dave Airlie
On Fri, Dec 7, 2012 at 9:05 AM, Tim Gardner wrote: > On 12/06/2012 03:46 PM, Dave Airlie wrote: > >>> >>> ttm_page_pool_init_locked(&_manager->wc_pool, GFP_HIGHUSER, >>> "wc"); >>> >>> @@ -817,6 +821,7 @@ int ttm_page_alloc_init(struct ttm_mem_global *glob, >>> unsigned max_pages) >>>

[PATCH 3.7-rc8] ttm: Fix possible _manager memory allocation oops

2012-12-06 Thread Dave Airlie
On Thu, Dec 6, 2012 at 4:20 PM, Tim Gardner wrote: > Memory for _manager is allocated using kzalloc() but the result is not > checked. > > Free _manager on error lest memory become orphaned. > > I was led to scrutinize ttm_page_alloc_init() from a smatch warning: > > drivers/gpu/drm/ttm/ttm_page

[PATCH 3.7-rc8] ttm: Fix possible _manager memory allocation oops

2012-12-06 Thread Tim Gardner
On 12/06/2012 03:46 PM, Dave Airlie wrote: >> >> ttm_page_pool_init_locked(&_manager->wc_pool, GFP_HIGHUSER, "wc"); >> >> @@ -817,6 +821,7 @@ int ttm_page_alloc_init(struct ttm_mem_global *glob, >> unsigned max_pages) >> &glob->kobj, "pool"); >>

Re: [PATCH 3.7-rc8] ttm: Fix possible _manager memory allocation oops

2012-12-06 Thread Dave Airlie
On Thu, Dec 6, 2012 at 4:20 PM, Tim Gardner wrote: > Memory for _manager is allocated using kzalloc() but the result is not > checked. > > Free _manager on error lest memory become orphaned. > > I was led to scrutinize ttm_page_alloc_init() from a smatch warning: > > drivers/gpu/drm/ttm/ttm_page_

[PATCH 3.7-rc8] ttm: Fix possible _manager memory allocation oops

2012-12-06 Thread Tim Gardner
Memory for _manager is allocated using kzalloc() but the result is not checked. Free _manager on error lest memory become orphaned. I was led to scrutinize ttm_page_alloc_init() from a smatch warning: drivers/gpu/drm/ttm/ttm_page_alloc.c:799 ttm_page_alloc_init() error: potential null dereferen

[PATCH 3.7-rc8] ttm: Fix possible _manager memory allocation oops

2012-12-06 Thread Tim Gardner
Memory for _manager is allocated using kzalloc() but the result is not checked. Free _manager on error lest memory become orphaned. I was led to scrutinize ttm_page_alloc_init() from a smatch warning: drivers/gpu/drm/ttm/ttm_page_alloc.c:799 ttm_page_alloc_init() error: potential null dereferen