video: tegra: host: Fix freeing a ERR_PTR value
authorTuomas Tynkkynen <ttynkkynen@nvidia.com>
Mon, 20 Aug 2012 14:26:16 +0000 (17:26 +0300)
committerSimone Willett <swillett@nvidia.com>
Wed, 22 Aug 2012 19:04:09 +0000 (12:04 -0700)
commitadf925fb2e1bf0c25e4427884260bf69780ff0bd
tree404bd7ea1b797efa51c703c44f4976fad09430db
parent6c679d9b3285f60df9acc335b19c1478f8ee92e3
video: tegra: host: Fix freeing a ERR_PTR value

nvhost_3dctx_alloc_common correctly checks the return value of an
allocator function, and attempts to perform cleanup. However, this
particular allocation API returns ERR_PTR values in case of failure,
which then gets passed to the deallocation function, causing a crash.

Also, the return value of that allocator API is checked with IS_ERR
in some places, and with IS_ERR_OR_NULL in others. For consistency
and avoiding surprises if the allocation implementation changes,
use IS_ERR_OR_NULL in all places.

Bug 1035878

Change-Id: I65ce97e11f9712b2e9630b38183f6e70bc14b254
Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Reviewed-on: http://git-master/r/124657
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/video/tegra/host/gr3d/gr3d.c
drivers/video/tegra/host/gr3d/gr3d_t20.c
drivers/video/tegra/host/gr3d/gr3d_t30.c
drivers/video/tegra/host/mpe/mpe.c