gpu: nvgpu: Fix NULL check for boardobj allocation

When we allocate boardobj object, we assign the allocated address
to *ppboardobj. The check for result of allocation checks looks
at address in ppboardobj.

Fix the check so that it actually checks results of kzalloc().

Change-Id: I90fda36afd1627efcf2fdea46bcd7ad1a7e3bb51
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1275738
GVS: Gerrit_Virtual_Submit
Reviewed-by: Thomas Fleury <tfleury@nvidia.com>
This commit is contained in:
Terje Bergstrom
2016-12-20 14:01:47 -08:00
committed by mobile promotions
parent 48a643c5e0
commit 61cb249f09

View File

@@ -33,7 +33,7 @@ u32 boardobj_construct_super(struct gk20a *g, struct boardobj **ppboardobj,
if (*ppboardobj == NULL) {
*ppboardobj = kzalloc(size, GFP_KERNEL);
if (ppboardobj == NULL)
if (*ppboardobj == NULL)
return -ENOMEM;
}