]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/media/i2c/adp1653.c
Merge tag 'trace-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux...
[karo-tx-linux.git] / drivers / media / i2c / adp1653.c
index ef75abe5984c38f37c0025e9e38b85a8d45e44a9..873fe1949e986fb513103924d5377d7e5d219de4 100644 (file)
@@ -417,7 +417,7 @@ static int adp1653_probe(struct i2c_client *client,
        if (client->dev.platform_data == NULL)
                return -ENODEV;
 
-       flash = kzalloc(sizeof(*flash), GFP_KERNEL);
+       flash = devm_kzalloc(&client->dev, sizeof(*flash), GFP_KERNEL);
        if (flash == NULL)
                return -ENOMEM;
 
@@ -443,7 +443,6 @@ static int adp1653_probe(struct i2c_client *client,
 
 free_and_quit:
        v4l2_ctrl_handler_free(&flash->ctrls);
-       kfree(flash);
        return ret;
 }
 
@@ -455,7 +454,7 @@ static int adp1653_remove(struct i2c_client *client)
        v4l2_device_unregister_subdev(&flash->subdev);
        v4l2_ctrl_handler_free(&flash->ctrls);
        media_entity_cleanup(&flash->subdev.entity);
-       kfree(flash);
+
        return 0;
 }