Showing error 788

User: Jiri Slaby
Error type: Memory Leak
Error type description: There the code omits to free some allocated memory
File location: drivers/media/video/saa5249.c
Line in file: 578
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2011-11-07 22:26:27 UTC


Source:

548#ifdef CONFIG_COMPAT
549        .compat_ioctl        = v4l_compat_ioctl32,
550#endif
551        .llseek         = no_llseek,
552};
553
554static struct video_device saa_template =
555{
556        .name                = "saa5249",
557        .fops           = &saa_fops,
558        .release         = video_device_release,
559};
560
561/* Addresses to scan */
562static unsigned short normal_i2c[] = { 0x22 >> 1, I2C_CLIENT_END };
563
564I2C_CLIENT_INSMOD;
565
566static int saa5249_probe(struct i2c_client *client,
567                        const struct i2c_device_id *id)
568{
569        int pgbuf;
570        int err;
571        struct video_device *vd;
572        struct saa5249_device *t;
573
574        v4l_info(client, "chip found @ 0x%x (%s)\n",
575                        client->addr << 1, client->adapter->name);
576        v4l_info(client, "VideoText version %d.%d\n",
577                        VTX_VER_MAJ, VTX_VER_MIN);
578        t = kzalloc(sizeof(*t), GFP_KERNEL);
579        if (t == NULL)
580                return -ENOMEM;
581        mutex_init(&t->lock);
582
583        /* Now create a video4linux device */
584        vd = kmalloc(sizeof(struct video_device), GFP_KERNEL);
585        if (vd == NULL) {
586                kfree(client);
587                return -ENOMEM;
588        }
Show full sources