Skip to content

Commit aea6a64

Browse files
Wei Yongjunrobclark
authored andcommitted
drm/msm: fix potential NULL pointer dereference
The dereference to 'pdata' should be moved below the NULL test. Signed-off-by: Wei Yongjun <[email protected]>
1 parent 6b8819c commit aea6a64

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/msm/msm_gpu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@
2929
static void bs_init(struct msm_gpu *gpu, struct platform_device *pdev)
3030
{
3131
struct drm_device *dev = gpu->dev;
32-
struct kgsl_device_platform_data *pdata = pdev->dev.platform_data;
32+
struct kgsl_device_platform_data *pdata;
3333

3434
if (!pdev) {
3535
dev_err(dev->dev, "could not find dtv pdata\n");
3636
return;
3737
}
3838

39+
pdata = pdev->dev.platform_data;
3940
if (pdata->bus_scale_table) {
4041
gpu->bsc = msm_bus_scale_register_client(pdata->bus_scale_table);
4142
DBG("bus scale client: %08x", gpu->bsc);

0 commit comments

Comments
 (0)