diff options
Diffstat (limited to 'drivers/media/i2c/vpx3220.c')
-rw-r--r-- | drivers/media/i2c/vpx3220.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/i2c/vpx3220.c b/drivers/media/i2c/vpx3220.c index 2f67b4c5c823..f02e74b9b1ac 100644 --- a/drivers/media/i2c/vpx3220.c +++ b/drivers/media/i2c/vpx3220.c @@ -499,7 +499,7 @@ static int vpx3220_probe(struct i2c_client *client, I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA)) return -ENODEV; - decoder = kzalloc(sizeof(struct vpx3220), GFP_KERNEL); + decoder = devm_kzalloc(&client->dev, sizeof(*decoder), GFP_KERNEL); if (decoder == NULL) return -ENOMEM; sd = &decoder->sd; @@ -521,7 +521,6 @@ static int vpx3220_probe(struct i2c_client *client, int err = decoder->hdl.error; v4l2_ctrl_handler_free(&decoder->hdl); - kfree(decoder); return err; } v4l2_ctrl_handler_setup(&decoder->hdl); @@ -566,7 +565,7 @@ static int vpx3220_remove(struct i2c_client *client) v4l2_device_unregister_subdev(sd); v4l2_ctrl_handler_free(&decoder->hdl); - kfree(decoder); + return 0; } |