diff options
author | Xianzhong <xianzhong.li@nxp.com> | 2019-03-29 10:10:56 +0800 |
---|---|---|
committer | Xianzhong <xianzhong.li@nxp.com> | 2019-03-29 14:54:18 +0800 |
commit | 17942905375a282ed9896c3cc778a246c321f5f0 (patch) | |
tree | 7ab47f349081643f5b27f2f97f9b62f8ee9cef6d /drivers/mxc/gpu-viv/hal/os/linux | |
parent | 10120a64fd9342c8effd21eb62bc51f88f1493cb (diff) |
MGS-4652 [#imx-1379] fix coverity dereference issue
CID: 5781508
device pointer should not be used before null check
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Diffstat (limited to 'drivers/mxc/gpu-viv/hal/os/linux')
-rw-r--r-- | drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c index ad3154b047c8..773db230cf74 100644 --- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c +++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c @@ -510,11 +510,16 @@ gc_version_show(struct seq_file *m, void *data) { gcsINFO_NODE *node = m->private; gckGALDEVICE device = node->device; - gcsPLATFORM * platform = device->platform; + gcsPLATFORM * platform = gcvNULL; if (!device) return -ENXIO; + platform = device->platform; + + if (!platform) + return -ENXIO; + seq_printf(m, "%s built at %s\n", gcvVERSION_STRING, HOST); if (platform->name) |