Skip to contentSkip to conversation

leds: dereferencing null

DISCUSSION Dan Carpenter 1 participant 1 message Mar 8, 2010 Kernel janitors

lore
Share & tools
lore
#0 lore raw

drivers/leds/leds-88pm860x.c +268 pm860x_led_probe(28) error: dereferencing undefined: 'pdata'
255 if (pdev->dev.parent->platform_data) {
256 pm860x_pdata = pdev->dev.parent->platform_data;
257 pdata = pm860x_pdata->led;
258 } else
259 pdata = NULL;

We set pdata to null here.

260
261 data = kzalloc(sizeof(struct pm860x_led), GFP_KERNEL);
262 if (data = NULL)
263 return -ENOMEM;

   264          strncpy(data->name, res->name, MFD_NAME_SIZE);
   265          dev_set_drvdata(&pdev->dev, data);
   266          data->chip = chip;
   267          data->i2c = (chip->id = CHIP_PM8606) ? chip->client : chip->companion;
   268          data->iset = pdata->iset;

^^^^^^^^^^^
We dereference it here.

regards,
dan carpenter