Skip to content

Commit

Permalink
drm/msm: fix potential NULL pointer dereference
Browse files Browse the repository at this point in the history
The dereference to 'pdata' should be moved below the NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
  • Loading branch information
Wei Yongjun authored and Rob Clark committed Sep 12, 2013
1 parent 6b8819c commit aea6a64
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/msm/msm_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@
static void bs_init(struct msm_gpu *gpu, struct platform_device *pdev)
{
struct drm_device *dev = gpu->dev;
struct kgsl_device_platform_data *pdata = pdev->dev.platform_data;
struct kgsl_device_platform_data *pdata;

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

pdata = pdev->dev.platform_data;
if (pdata->bus_scale_table) {
gpu->bsc = msm_bus_scale_register_client(pdata->bus_scale_table);
DBG("bus scale client: %08x", gpu->bsc);
Expand Down

0 comments on commit aea6a64

Please sign in to comment.