msm: kgsl: Fix the access to invalid pool
If a free page is not found in a particular pool, we
fall back to lower order pools. While doing so make
sure we dont do that when already in zero order pool.
For zero order(pool_idx = 0) pool, (pool_idx-1) value
becomes -1 that is invalid and compiler throws the error
that array subscript is below bounds.
This problem is exposed when we enable kernel config option
"CONFIG_ALLOC_BUFFERS_IN_4K_CHUNKS" which will force only
zero order pool and hence the index value calculation to -1.
Change-Id: I81e8a1e79cd974b7a13a9d23cb3d809464b6dcda
Signed-off-by:
Sunil Khatri <sunilkh@codeaurora.org>
Loading
Please register or sign in to comment