Showing error 1820

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: drivers/mfd/sm501.c
Line in file: 1354
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-11 08:47:26 UTC


Source:

1324
1325        dev_info(sm->dev, "SM501 At %p: Version %08lx, %ld Mb, IRQ %d\n",
1326                 sm->regs, devid, (unsigned long)mem_avail >> 20, sm->irq);
1327
1328        sm->rev = devid & SM501_DEVICEID_REVMASK;
1329
1330        sm501_dump_gate(sm);
1331
1332        ret = device_create_file(sm->dev, &dev_attr_dbg_regs);
1333        if (ret)
1334                dev_err(sm->dev, "failed to create debug regs file\n");
1335
1336        sm501_dump_clk(sm);
1337
1338        /* check to see if we have some device initialisation */
1339
1340        pdata = sm->platdata;
1341        idata = pdata ? pdata->init : NULL;
1342
1343        if (idata) {
1344                sm501_init_regs(sm, idata);
1345
1346                if (idata->devices & SM501_USE_USB_HOST)
1347                        sm501_register_usbhost(sm, &mem_avail);
1348                if (idata->devices & (SM501_USE_UART0 | SM501_USE_UART1))
1349                        sm501_register_uart(sm, idata->devices);
1350                if (idata->devices & SM501_USE_GPIO)
1351                        sm501_register_gpio(sm);
1352        }
1353
1354        if (pdata->gpio_i2c != NULL && pdata->gpio_i2c_nr > 0) {
1355                if (!sm501_gpio_isregistered(sm))
1356                        dev_err(sm->dev, "no gpio available for i2c gpio.\n");
1357                else
1358                        sm501_register_gpio_i2c(sm, pdata);
1359        }
1360
1361        ret = sm501_check_clocks(sm);
1362        if (ret) {
1363                dev_err(sm->dev, "M1X and M clocks sourced from different "
1364                                        "PLLs\n");
Show full sources